0

My application is not resuming to previous state when it is reopen Although its working well when a call is recieved or other application is open and then closed it comes in front

but

when HOME_KEY is pressed it start from first activity.

It not happened on Emulator it Happens only on device

It happens from any activity among many activities in my app

Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95

1 Answers1

0

Do you reimplement the onResume() method in your activity?

I'm not sure what state you need to restore, but perhaps Saving Android Activity state using Save Instance State might help (duplicate?)?

You are familiar with the activity lifecycle?

Community
  • 1
  • 1
Mats Adborn
  • 504
  • 2
  • 7
  • yes i've done and so that when phone call recieved and other app is come in front it resume back to current activity the problem is with only when home button is clicked and also it not in emulator it happen on device MOTO only – Trikaldarshiii Jun 07 '12 at 08:52
  • Sounds like a device/model specific problem. Could it be that your device runs garbage collection on that activity? As you might be aware, pausing an app does not guarantee it will be resumed; memory might be needed elsewhere during the app's paused state and therefore GCed. Perhaps you run some background service app, like a network, memory or battery saver, which automatically kills processes? – Mats Adborn Jun 07 '12 at 09:11
  • i'm sure my app process is not killed and also i found that every time my main activity is started not the new session all the previous session is just fill the stack on one another – Trikaldarshiii Jun 07 '12 at 09:29
  • Try uninstalling the app on your device, and then reinstall it again. – Mats Adborn Jun 07 '12 at 09:40