Ingrid Cooper
Ingrid Cooper

Reputation: 1211

On minimizing my app and opening it again why is my app starting from the Splash screen again?

In my application after navigating from the Splash screen to another activity, I minimize it by pressing the Home button and then open my application again and instead of opening from the activity that I was last in, it starts from the Splash screen again.

Can you please tell me why this is happening?

Upvotes: 3

Views: 3168

Answers (2)

Ravi Swaminathan
Ravi Swaminathan

Reputation: 43

In your scenario,after installing the application,if you press the OPEN button the your activity will be brought to front not created. Please paste the following code in your first activity and test it. It works for me.

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
    // Here activity is brought to front, not created,
    // so finishing this will get you to the last viewed activity
    finish();
    return;
  }
}

Upvotes: 3

rekire
rekire

Reputation: 47945

Properly you application has been exited. If you app need much memory it is very common that the app will be terminated by the system.

Upvotes: 0

Related Questions