1

I use Application class to store my android application global parameters.But when I go to other app and stay my app to background for about several minutes, my app can not run again. Because I get parameters from the Application class but now it becomes empty.

My question is why it like that and how to solve this problem? And I also saw a thread follows:

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

The answer is using onSaveInstanceState(). But how can I save all my application parameters in it? Thank you

.

Community
  • 1
  • 1
  • i guess you didn't see all the recommended "look-at-these-before-you-post" questions. look here: http://stackoverflow.com/questions/151777/saving-activity-state-in-android – bad_keypoints Jan 28 '13 at 07:47

1 Answers1

2

why don't you use shared preferences to save your data? OS kills your application if it is on background and it needs resources...

Buda Gavril
  • 21,409
  • 40
  • 127
  • 196