'Action back / onbackpressed at fragment make field at previous fragment recreate and that make field clear value
I have two fragment in my app. The first is login, the second is OTP fragment. In OTP fragment when I press onBackPressed() the value in textfield at login fragment is missing. How I can make all value in textfield at login fragment still exist?
Solution 1:[1]
Which methods do you use to open OTP framgent ?? Add or replace.
Maybe you are using replace so when you press back, the view of login fragment will be recreated
You may find the diff here: Difference between add(), replace(), and addToBackStack()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Trung Nguyen |
