App always starts fresh from root activity instead of resuming background state (Known Bug)
Solution 1:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
// Activity was brought to front and not created,
// Thus finishing this will get us to the last viewed activity
finish();
return;
}
// Regular activity creation code...
}
Solution 2:
This is due to the intents being used to start the app being different. Eclipse starts an app using an intent with no action and no category. The Launcher starts an app using an intent with android.intent.action.MAIN action and android.intent.category.LAUNCHER category. The installer starts an app with the android.intent.action.MAIN action and no category.
Whoever submitted the bug should have probably worded it as a request for enhancement to the Eclipse plugin since they apparently want Eclipse to have the ability to pretend to be the launcher and to start apps using the same intent as the launcher.