For an unknown reason, I can't get my application leaving properly so that when I push the home button and the app icon again, I resume where I was in the app. I would like to force the application to restart on the first Activity.
I suppose this has something to do with onDestroy() or maybe onPause() but I don't know what to do.
You can use Jake Wharton's lib ProcessPhoenix in order to restart your application process.
if you want to always start at the root you want to set android:clearTaskOnLaunch to true on your root activity
Does FLAG_ACTIVITY_CLEAR_TOP do what you need to do?
Use this property in manifest file in starting class (first activity).
this worked for me: