Answer the question
In order to leave comments, you need to log in
Activity lifecycle control?
Good day! There is an application for the university schedule , in which there are 5 activities (see diagram):
The main activity is schedule, if the user launches the application for the first time, then he follows this path: departments => groups => schedule, otherwise immediately schedule. There are 2 items in the settings activity, when you click on one of them, the favorite list is erased, and the second allows you to change your group, launches the departments => groups => schedule activity. I want to do the following: if the user is in the schedule activity, i.e. Most importantly, by pressing the "back" button, he will exit the application, no matter what happened in the application before, roughly speaking, so that the application life cycle is limited to the transitions indicated in the diagram. I tried storing activity instances and calling .finish(), but this is probably the worst way! It often happened that if you minimize the application on some activity (not the main one), and then expand it, then everything crashed. How can I do what I want?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question