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

Discussion in 'Android Questions' started by rleiman, Mar 11, 2018.

  1. rleiman

    rleiman Well-Known Member Licensed 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.
     
  2. Erel

    Erel Administrator Staff Member Licensed 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?
     
  3. rleiman

    rleiman Well-Known Member Licensed User

    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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. rleiman

    rleiman Well-Known Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice