In my app, my own Application class saved some static variables, after clicked home button in my application, the screen go back to home. now i want to resume my application, when i click my app icon in launcher, the variables of the variables before are null, but onlongclick home button and choose my application, the variables is normal~
Asked
Active
Viewed 272 times
-1
-
Since every device can behave differently, in your case, what does long clicking the home button do? Also, might be related: http://stackoverflow.com/questions/1944369/android-static-object-lifecycle-application-act-crazy/1944564#1944564 – Andrew T. Apr 16 '14 at 04:15
1 Answers
0
When you click app icon from the launcher at that time second instance generated for your app.To solve this issue you have to manage with single instance. For that you can use
android:launchMode="singleTask" or
android:launchMode="singleInstance"
` in your manifest for activity
Refer this question too