2
In my Android project I navigate between fragments
, in one of these fragments
, there is a list that receives information from a json
.
It appeared the need to update this list every 1 minute, I’m using
postDelayed(this, 60000);
which calls a thread, which uses
changeActivity(ActivitiesListFragment.class, null);
to update the list.
It’s working, the list is updated in a new fragment
.
The problem is that when I press the back button, it goes back to the previous list as it was not "destroyed".
How do I start a new fragment
and exclude the fragment
previous?
You could use the Fragments backstack here you have an answer, then I put an answer here http://stackoverflow.com/a/18306258/3861347
– Wellington Avelino
When adding Fragment, use replace, not add. This way you will always have only one Fragment.
– Luiz