Good mood to you all! The application has several windows (Activity). When the user exits the application, you need to remember which window the user viewed last, and when you restart the application, show it to him, not MainActivity. If I am mistaken, correct it - the logic is this: when you destroy a window, SOMETHING is written to the settings file (Preferences), then the required window is read from the same file when you create the MainActivity. It is not known what needs to be recorded in order to later call the window with intention (Intent).
- 2You save any identifier, for example, a sequence number of some kind .. then call the desired content using this number. - pavlofff
- Do I understand correctly that as such there is no DIRECT link to a class that could be written to the settings file? - St-St
- @ St-st and why a direct link? pavloff told you everything correctly - Android Android
- @ Android Android additional question asked for a better understanding of the device of the android world, and my capabilities in it. - St-St
|
1 answer
Well, you can write some value in the SharedPreference and let's make this condition:
if(вытаскиваем значение из кэша){ StartActivity такое-то } True, if Pts is a lot of Activity, then it will be a cumbersome decision ... but for a small amount of Activity it will do.
- Thank you. Through the switch will be more beautiful. - St-St
|