0

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?

1 Answers1

0

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()