I have a very hard to pin down problem.
When I install my app from the marketplace, I sometimes see the following behavior:
- Navigating away from the app calls onStop, as expected
- Returning to the app calls onCreate for the main activity, instead of just onRestart/onResume
onCreate will keep getting called every time a user leaves/returns to the app, no matter what. Obviously, this causes big issues in terms of state, etc.
Sometimes rebooting the phone fixes this problem, sometimes not. Installing from .adb prevents this behavior.
Log from behaving app, on icon touch (while running already):
2-10 18:56:33.855: INFO/ActivityManager(1482): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.sidekickApp/.Main } from pid 1604
02-10 18:56:33.855: VERBOSE/HtcAppUsageStats(1482): (launch app, package): (Sidekick App, com.sidekickApp)
02-10 18:56:33.865: DEBUG/PhoneWindow(1604): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@40547888 has no id.
02-10 18:56:33.865: DEBUG/Background traffic light(1604): traffic light: GREEN, mBackgroundTrafficLight = false
02-10 18:56:33.895: VERBOSE/Main(2648): Debug: onRestart()
02-10 18:56:33.895: DEBUG/Main(2648): Debug: onResume()
Log from messed up app:
02-10 18:39:35.813: INFO/ActivityManager(1477): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.sidekickApp/.Main bnds=[360,586][477,704] } from pid 1583
02-10 18:39:35.843: VERBOSE/HtcAppUsageStats(1477): (launch app, package): (Sidekick App, com.sidekickApp)
02-10 18:39:35.873: DEBUG/Background traffic light(1583): traffic light: GREEN, mBackgroundTrafficLight = true
02-10 18:39:35.903: VERBOSE/Main(7364): Debug: onCreate()
I am desperate here. Any ideas?