M
M
mitaichik2019-06-19 15:20:51
Android
mitaichik, 2019-06-19 15:20:51

Where to change fragment when restoring Activity?

Such a case: there is an Activity where different fragments are placed. Let's say it has one fragment. The user minimizes the Activity. At this time, the background process changes some state, and when the user opens the application again (accordingly, the Activity is restored), then we should show him a completely different fragment (since the one that was when minimized is no longer relevant).
Question: how to do it correctly and in what place (onCreate / onResume, etc.)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
postflow, 2019-06-21
@postflow

Check the new state on onResume and change the fragment if necessary

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question