There are three different cases:
1) A user launches an app, navigates in it, pressed home and click on the app icon again to launch our app again.
2) A user
You can call this.finish()
on the onPause()
of your Activity
, that way the activity will be closed in the three cases.
1) define a public static normalPause = true
variable in a Class.
2) in onPause
method of all of your activities set it false (I am worry. We might not be in a normal pause)
2) in onCreate
method of all of your activities set it true (Do not worry. We are in a normal pause)
3) in onResume
of all of your Activities:
if(!Utilities.normalPause)
{
this.finish()
}
Enjoy!
Perhaps, android:noHistory is what you're looking for. If you declare all your activities except StartupActivity
with this attribute, then they will be finished as the user navigates away from them and only StartupActivity
will appear.