Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignoring navigate() call: FragmentManager has already saved its state

I'm using navigation in MainActivity, then I start SecondActivity (for result). After finish of SecondActivity I would like to continue with navigation in MainActivity, but FragmentManager has saved his state already.

On Navigation.findNavController(view).navigate(R.id.action_next, bundle) I receive log message:

Ignoring navigate() call: FragmentManager has already saved its state

How I can continue in navigation?

like image 410
Francis Avatar asked Aug 17 '18 12:08

Francis


1 Answers

You must always call super.onActivityResult() in your Activity's onActivityResult. That is what:

  1. Unlocks Fragments so they can do fragment transactions (i.e., avoid the state is already saved errors)

  2. Dispatches onActivityResult callbacks to Fragments that called startActivityForResult.

like image 149
ianhanniballake Avatar answered Oct 28 '22 18:10

ianhanniballake