0

I have a Problem with my Application that when it goes to the background and then return back after 2-3 minutes of inactivity, then Application's on-Create method is called and values are set to the default values, kindly help me to diagnose this Problem and further Application contains a lot of sounds and image-processing in it, may be this fact causes an issue. Thanks

Muhammad Farhan Habib
  • 1,859
  • 20
  • 23
  • 1
    Please show some code. It is possible that when your app goes to background, it is killed to reclaim memory - that would explain the `onCreate()` being called. But without code, it is difficult to pin point. – curioustechizen Feb 01 '12 at 05:41

1 Answers1

5

If you did not save your application values in onSaveInstanceState(), they will not be available to you in onCreate(). Save your values in onSaveInstanceState(), and you will be able to get them back in onCreate(). It's as simple as that.

David Merriman
  • 6,056
  • 1
  • 18
  • 18