As I see most of application resumes last activity when launcher icon is clicked. However it seems that this is not default behavior. In my application launcher activity is always started when launcher icon is clicked.
How can i configure my application to resume last activity when launcher icon is clicked and application is already running.
I'm not qualified to say this a bug, but this behaviour has been around since the first Android version. There is a problem with tasks and roottasks in release builds when starting the application from the launcher. You can find the related bug report here.
It can be fixed adding following code to your onCreate of your launcher activity:
if (!isTaskRoot()) {
finish();
return;
}
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