0

My app has two activities. When launching app with touching app icon, main activity starts. And go to sub activity then press home button. Then Kill app using task Killer. It is a point that I want restart app when user select app from recent list, but app starts from subactivity.

Does Anyone know how to solve this problem?

user2155454
  • 95
  • 3
  • 12

2 Answers2

0

you need to override method onStop() in your sub activity and call finish() this way your sub activity will be killed when home button is pressed and restarts from the first activity

0

You can write the following line in of androidmanifest.xml:android:launchMode="singleInstance" , or try something like this :

startActivity(new Intent(this,Myclass.class)); this.finish(); //after you called the subactivity you just end the main activity