1

I would like to ask how I am going to save the state between the fragments while using bottom navigation. For example, if I am on "HomeFragment" and I go inside it with a "MovieDetailsFragment" and then I touch on "SettingsFragment" which is on the bottom navigation as "HomeFragment" and then I go back from SettingsFragment to HomeFragment I need to see the MovieDetailsFragment since I want to keep this state, instead of the fresh reloaded HomeFragment.

Now when I go from SettingsFraggment to HomeFragment, I am getting the fresh loaded HomeFragment instead of its inside fragment which is MovieDetailsFragment. This is a sign that the app is not storing any of this state.

2
  • How are you saving your fragment's state? How are you 'going back from SettingFragments to HomeFragment' - by pressing the bottom navigation button associated with the HomeFragment? Commented Mar 18, 2023 at 20:31
  • I am sending the details from HomeFragment to MovieDetailsFragment by bundle, but i need to save that action when I entered the MovieDetailsFragment from HomeFragment so when i go to SettingsFragment and then back to HomeFragment I will see the MovieDetailsFragment. Yes, I am moving between HomeFragment and SettingsFragment using the bottom navigation's buttons. In order to go to MovieDetailsFragment I need to be inside HomeFragment. Commented Mar 19, 2023 at 13:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.