I have an app with 2 activities. 1st is a login screen, 2nd is a data screen.
I need to know while in the 2nd activity if the user pressed the HOME button.
This app will be on a tablet shared by several people. If the person logged in presses the HOME button, the app needs to return to the login screen upon restart, otherwise the next person using the app would continue where the first person left off. (I can't seem to get them to use a LOGOUT button, they keep using HOME and thinking that logs them out.)
I know pressing HOME calls the Activity_Pause, so I put an activity.Finish there. Unfortunately, Activity_Pause is also called for orientation changes and every time the user changed orientation, it logged them out.
I have a partial fix that is ugly, with flags being set-read etc. But it is giving me problems and I thought before I continued I would ask if I am re-inventing the wheel here.
So . . . Is there a definitive way of telling that the HOME button has been pressed?
Or . . . Is there a way of telling that the app is returning from pausing from the HOME being pressed and not an orientation change.
Sincere Thanks for any help!!
I need to know while in the 2nd activity if the user pressed the HOME button.
This app will be on a tablet shared by several people. If the person logged in presses the HOME button, the app needs to return to the login screen upon restart, otherwise the next person using the app would continue where the first person left off. (I can't seem to get them to use a LOGOUT button, they keep using HOME and thinking that logs them out.)
I know pressing HOME calls the Activity_Pause, so I put an activity.Finish there. Unfortunately, Activity_Pause is also called for orientation changes and every time the user changed orientation, it logged them out.
I have a partial fix that is ugly, with flags being set-read etc. But it is giving me problems and I thought before I continued I would ask if I am re-inventing the wheel here.
So . . . Is there a definitive way of telling that the HOME button has been pressed?
Or . . . Is there a way of telling that the app is returning from pausing from the HOME being pressed and not an orientation change.
Sincere Thanks for any help!!