Muhammad Farhan Habib
Muhammad Farhan Habib

Reputation: 1809

Returning after a period of inactivity in my Android Application causes destroy set Values

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

Upvotes: 0

Views: 242

Answers (1)

David Merriman
David Merriman

Reputation: 6086

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.

Upvotes: 5

Related Questions