Horaceman
Horaceman

Reputation: 786

Avoiding to launch the app again

I've developed an app and everything is fine, but if a push the 'Home' buttom, it goes to the home screen. All right til then. But if i click on the icon to come back to the app... sometimes it comes back to the old instance of the app and sometimes it launches a new instance of the app over the old one. I don't get why or when makes every casescenario happen.

Is there any way of avoiding this and come back always to the old one?

Thanks.

Upvotes: 1

Views: 616

Answers (1)

BFil
BFil

Reputation: 13096

Try setting your activity launch mode to singleTop

Refer to the following answer:

Android: new Intent() starts new instance with android:launchMode="singleTop"

Upvotes: 1

Related Questions