Android Question Making sure app always starts on the it's home screen

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

I would like to make sure all of my apps start on it's home screen every time the app is run.

I noticed that sometimes the user can open my app and go to a setting screen, then go to another screen within the app from the app's home screen. That's 3 activities deep within the app. If they tap the phone's home button and then go back into the app, the screen where they were in previously before tapping the home button will be displayed. Other times, the app's home screen will be displayed. Without doing anything else, they tap the exit button from the home screen to call Activity.Finish

Instead of the phone's home screen showing, the screen the user was in previously before tapping the home button will be displayed. This happens to all apps I have made so far.

To get around this in all of my apps, can you tell me if there is a command I can issue to start at the home screen and allow Activity.Finish to close the app and return to the phone home screen?

Thanks.
 

rleiman

Well-Known Member
Licensed User
Longtime User
This is the standard Android behavior. It is similar to pressing on the recent apps button to switch between applications. Why do you want to prevent the user from returning to the previous state?

Hi Erel,

Because returning to the previous state is not consistent. It's difficult to reproduce the issue. Sometimes the screen the user was on is remembered after the user taps the home button and later taps the app icon and sometimes the app home screen will be displayed loosing the previous state. When this happens and the user taps a button on the home screen that calls Activity.Finish will cause the previous state screen to be displayed instead of exiting the app.

Seems like Android keeps a queue or stack history of the loaded activities and the order somehow gets messed up if the user taps the phone home button.
 
Upvote 0
Top