I have an app which has 4 activities in it.Within app, history activities, i.e. Activities from where I navigated should not be destroyed , so I don't call finish() when I am navigating.
But when I press HOME button I want to kill all activities , So that When I come back to the app , Index screen or say first activity is displayed instead of previous paused activity.
Problem here seems to be, how to differentiate between backs within an app to HOME button.
I saw few answers regarding this in other questions. Got more confused.
Is there a way other than intercepting HOME KEY PRESS, because as suggested in other threads,
I should not override HOME key press (as it might have side effects)
Set android:clearTaskOnlaunch="true"
on the activity launched from the home screen.
You might also check some of the other attributes you can specify on activity, to tweak it's behavior a bit more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With