Reputation: 6128
I have MyApp ready, Now I see this bug, When I install the app it displays the splash screen, and moves to second activity and so on.Now when I click on HOME
button and again start the app it starts from beginning and not from where I had left and this happens only when I install the app from Eclipse, and I notice that after the app restarts from beginning when I click back I can see that activity where I had left earlier?
I have looked into the following links:
https://code.google.com/p/android/issues/detail?id=14262
How to prevent multiple instances of an activity when it is launched with different intents
Upvotes: 3
Views: 2282
Reputation: 1400
I think this is a bug in Android.
Please perform following steps.
1)Delete your application and reinstall it.
2) After installing the application, it will display two option "Done" & "Open" click on Done button.
3) Now open the application from the application menu. Your problem will be solved.
When ever the HOME button is pressed, the application will start from the state where it left.
Upvotes: 10
Reputation: 331
If you are relaunching the same activity multiple times, please make use of intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
or other Intent flags as applicable and also finish()
your activities if they are not required in the activity chain.
You can as well control your back button using onKeyDown
and control the presence on your activities explicitly.
Upvotes: 2