validation on fragment is not working after back pressed
See original GitHub issueI am using kotlin DSL for validation. I have multiple fragments opening after one another for user input. Each fragment has validation using code:
Sample code
private val validations by lazy {
validationSet(
validations = listOf(
binding.txtSomething.isRequired(errorMessage = getString(R.string.field_required))
),
actions = actions
validateByClickingOn binding.btnNext
whenOnSuccess ::onValidationSuccess
)
}
If I press the back button in between, validation stops working.
Observations:
apply { validations }
gets called once again once user comes back on fragmentvalidateByClickingOn binding.btnNext
whenOnSuccess ::onValidationSucces
does not get called second time
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
android - Back button not working in fragments - Stack Overflow
Whenever I use this code, I can't go back to previous page on back press on other fragments, it just works in the...
Read more >Communicating with fragments - Android Developers
To keep fragments self-contained, you should not have fragments communicate directly with other fragments or with its host activity.
Read more >Implement Form Validation (Error to EditText) in Android
When user data is corrected by the user -> // There is no need to give the error message when the user //...
Read more >Building dynamic user interfaces in Android with fragments
The fragment instance is associated with an activity instance.The fragment and the activity is not fully initialized. Typically you get in this method...
Read more >Camera preview disappears after Fragment onPause ...
Relnote: "Fix PreviewView black screen issues when swiped out Preview fragment and then swiped back in ViewPager2. Also fixed the issue when
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your update fixed the issue 👍
Hi @ParitoshVaidya
After a lot of problems with my environment, I published the 3.2.0-SNAPSHOT update.
Please try again and let me know.
I hope it works. 😃