My application is basically one Activity that I quit by calling
this.finish();
System.exit(0);
where this is the main activity. Now after the program shuts down, I go to settings -> Applications -> my app and on Gingerbread, I see the program has finished. But on both Honeycomb and ICS the button “Force Close” is active.
Also if I now try to restart my program, on both ICS and Honeycomb the program crashes on start.
edit:
Ok, the restart problem seems to be caused by Mobclix adview throwing this:
ERROR/webcoreglue(31958): *** Uncaught exception returned from Java call!
WARN/System.err(31958): java.lang.IllegalStateException: Call CookieSyncManager::createInstance() or create a webview before using this class
WARN/System.err(31958): at android.webkit.JniUtil.checkInitialized(JniUtil.java:45)
WARN/System.err(31958): at android.webkit.JniUtil.getDatabaseDirectory(JniUtil.java:66)
WARN/System.err(31958): at android.webkit.CookieManager.nativeSetAcceptCookie(Native Method)
WARN/System.err(31958): at android.webkit.CookieManager.setAcceptCookie(CookieManager.java:287)
WARN/System.err(31958): at com.mobclix.android.sdk.MobclixFullScreenAdView.initialize(MobclixFullScreenAdView.java:219)
WARN/System.err(31958): at com.mobclix.android.sdk.MobclixFullScreenAdView.<init>(MobclixFullScreenAdView.java:37)
So it’s possible that my problem is some cleanup I need to do with mobclix lib when finishing my app?
edit2: Ok, the mobclix problem was a known issue in the lib.
You should never ever call System.exit(0), it’s not what Android application should do.
Under the hook, Android OS may not necessarily destroy the process that the application resides in, to facilitate faster application restart, changes to the policy on how finished applications are kept probably generates the difference you see between Honeycomb/ICS and Gingerbread.
In any case, remove System.exit(0) and you should be fine 🙂