0

I want to restart an instance of my activity. Is it possible?

For example from an activity, I will go to another activity then when I go back to previous activity, all is new, no instance is saved.

I'm kinda new to android. thanks.

2 Answers2

0

I just solved this by adding this line into my android manifest:

android:launchMode="singleInstance"

This is you declaring that you don't want to instantiate a new activity every time you start an intent of one. You can now reuse existing activities. Here's a link to the API document that explains this and other activity tweaks in the manifest file:

http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

This is an old question but hopefully this answer can help people still trying to figure this out.

ThePartyTurtle
  • 2,276
  • 2
  • 18
  • 32
0

Maybe this old post could help you: how do i restart an android activity

Community
  • 1
  • 1
e-cal
  • 1,661
  • 2
  • 20
  • 28