Issue
Once an app has been put into the background after going back it hangs in splash screen.
Tested on
LG ally 2.2 (stack trace below) > it shows a black screen then app gets restarted
Razr 2.3.5 (stack trace below) > it returns to the latest window working as expected
Steps to reproduce
1. Build & Run an app
2. Hit the Home key
3. Expect more-less 30 minutes
4. Go back to the Titanium app
tiapp.xml
<property name="ti.android.threadstacksize" type="int">65536</property>
<property name="ti.android.largeHeap" type="bool">true</property>
<property name="ti.android.fastdev" type="bool">false</property>
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:installLocation="auto">
<activity android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation"
android:label="OnForce" android:name=".OnforceActivity" android:theme="@style/Theme.Titanium">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<supports-screens android:anyDensity="false"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
</manifest>
</android>
Stack Trace - LG ally 2.2
05-24 13:02:19.289: I/dun_service(1516): process rmnet event
05-24 13:02:19.289: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:20.129: I/ActivityManager(1347): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.appcelerator.onforce/.OnforceActivity }
05-24 13:02:20.169: I/ActivityManager(1347): Start proc com.appcelerator.onforce for activity com.appcelerator.onforce/org.appcelerator.titanium.TiActivity: pid=23782 uid=10065 gids={1015, 1006, 3003}
05-24 13:02:20.189: W/InputManagerService(1347): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44e9eee0
05-24 13:02:20.489: I/TiApplication(23782): (main) [0,0] checkpoint, app created.
05-24 13:02:20.869: I/TiApplication(23782): (main) [381,381] Titanium 2.0.1 (2012/04/12 16:36 999c68a)
05-24 13:02:21.089: I/TiApplication(23782): (main) [227,608] Titanium Javascript runtime: v8
05-24 13:02:21.139: W/TiBaseActivity(23782): (main) [45,653] Unsupported, out-of-order activity creation. Finishing.
05-24 13:02:21.139: W/TiApplication(23782): (main) [3,656] Scheduling application restart
05-24 13:02:21.439: I/ActivityManager(1347): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x4 cmp=com.appcelerator.onforce/.OnforceActivity (has extras) }
05-24 13:02:21.439: W/ActivityManager(1347): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x4 cmp=com.appcelerator.onforce/.OnforceActivity (has extras) }
05-24 13:02:21.469: I/TiRootActivity(23782): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
05-24 13:02:22.069: I/dun_service(1516): process rmnet event
05-24 13:02:22.069: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:22.489: E/TiApplication(23782): (KrollRuntimeThread) [1022,1022] APP PROXY: ti.modules.titanium.app.AppModule@44ad7eb0
05-24 13:02:22.619: W/V8Object(23782): Runtime disposed, cannot set property 'userAgent'
05-24 13:02:22.999: E/TiAPI(23782): !!!
05-24 13:02:22.999: E/TiAPI(23782): !!! WARNING : Use of unsupported constant Ti.UI.iPhone.TableViewSeparatorStyle.NONE !!!
05-24 13:02:22.999: E/TiAPI(23782): !!!
05-24 13:02:23.188: I/dun_service(1516): process rmnet event
05-24 13:02:23.188: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:23.819: I/dun_service(1516): process rmnet event
05-24 13:02:23.819: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:24.719: I/dun_service(1516): process rmnet event
05-24 13:02:24.719: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:25.159: I/dun_service(1516): process rmnet event
05-24 13:02:25.159: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:25.179: I/TiAPI(23782): [13:2:25] {adroidTabGroup} adding fake event blur
05-24 13:02:25.189: I/TiAPI(23782): [13:2:25] {adroidTabGroup} adding fake event focus
05-24 13:02:25.519: I/ActivityManager(1347): Starting activity: Intent { cmp=com.appcelerator.onforce/org.appcelerator.titanium.TiActivity (has extras) }
05-24 13:02:25.789: I/TiRootActivity(23782): (main) [0,0] checkpoint, on root activity resume. activity = com.appcelerator.onforce.OnforceActivity@44ac1d40
05-24 13:02:25.819: D/TiUIView(23782): (main) [31,31] Nativeview is null
05-24 13:02:26.019: I/dun_service(1516): process rmnet event
05-24 13:02:26.019: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:26.199: D/TiUIView(23782): (main) [374,405] Nativeview is null
05-24 13:02:26.879: D/TiUIView(23782): (main) [681,1086] Nativeview is null
05-24 13:02:26.879: I/dun_service(1516): process rmnet event
05-24 13:02:26.879: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:26.999: I/ActivityManager(1347): Displayed activity com.appcelerator.onforce/org.appcelerator.titanium.TiActivity: 1133 ms (total 6841 ms)
05-24 13:02:27.862: I/dun_service(1516): process rmnet event
05-24 13:02:27.862: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:28.657: I/dun_service(1516): process rmnet event
05-24 13:02:28.657: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:29.112: I/dun_service(1516): process rmnet event
05-24 13:02:29.112: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:29.443: I/dun_service(1516): process rmnet event
05-24 13:02:29.443: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:29.950: I/dun_service(1516): process rmnet event
05-24 13:02:29.950: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
05-24 13:02:30.671: I/dun_service(1516): process rmnet event
05-24 13:02:30.671: I/dun_service(1516): rstate == DUN_RMNETSTATE_ERROR in dun_monitor_kevents
Stack trace - Razr 2.3.5
05-24 13:03:23.257: D/dalvikvm(16599): GC_EXPLICIT freed 95K, 46% free 3470K/6343K, external 2357K/2773K, paused 59ms
05-24 13:03:23.265: I/Gmail(16599): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 530528, normalSync: true
05-24 13:03:23.992: W/Settings(884): Setting wifi_networks_available_notification_on has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
05-24 13:03:23.992: I/ActivityManager(512): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.appcelerator.onforce/.OnforceActivity } from pid 884
05-24 13:03:24.070: D/ActivityRenderTarget(884): onPause
05-24 13:03:24.156: I/gralloc(512): Allocated 0x660072 size 6488161
05-24 13:03:24.187: W/InputManagerService(512): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40a76750 (uid=10035 pid=884)
05-24 13:03:24.195: I/ActivityManager(512): Resumed Activity: com.appcelerator.onforce/org.appcelerator.titanium.TiActivity totalTime: 204 ms
05-24 13:03:25.335: I/gralloc(512): Allocated 0x660072 size 6488161
05-24 13:03:29.265: D/dalvikvm(7750): GC_EXPLICIT freed 24K, 43% free 3304K/5767K, external 2368K/2773K, paused 59ms
Device where splash screen is hanging
LG Optimus running 2.2.2, it was stuck on the splash screen after trying to relaunch the app after half an hour.
Here are the logs for this test:
05-30 14:36:53.660: INFO/ActivityManager(114): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.appcelerator.onforce/.OnforceActivity }
05-30 14:36:53.700: ERROR/TiBaseActivity(7818): (main) [2019042,2082106] Layout cleanup.
05-30 14:36:53.850: ERROR/TiBaseActivity(7818): (main) [157,2082263] Layout cleanup.
05-30 14:36:54.120: INFO/TiRootActivity(7818): (main) [0,0] checkpoint, on root activity resume. activity = com.appcelerator.onforce.OnforceActivity@45b2b820
05-30 14:36:54.580: INFO/ActivityManager(114): Displayed activity com.appcelerator.onforce/.OnforceActivity: 2087206 ms (total 2087206 ms)
05-30 14:37:12.860: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:37:12.860: INFO/dun_service(243): Post event 1
05-30 14:37:12.870: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:37:12.870: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:37:14.770: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:37:14.770: INFO/dun_service(243): Post event 1
05-30 14:37:14.770: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:37:14.780: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:37:50.900: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:37:50.900: INFO/dun_service(243): Post event 1
05-30 14:37:50.900: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:37:50.900: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:38:27.120: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:38:27.120: INFO/dun_service(243): Post event 1
05-30 14:38:27.120: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:38:27.120: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:38:29.020: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:38:29.020: INFO/dun_service(243): Post event 1
05-30 14:38:29.030: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:38:29.030: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:38:33.940: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:38:33.940: INFO/dun_service(243): Post event 1
05-30 14:38:33.951: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:38:33.951: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:38:35.040: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:38:35.040: INFO/dun_service(243): Post event 1
05-30 14:38:35.050: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:38:35.050: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:39:13.150: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:39:13.150: INFO/dun_service(243): Post event 1
05-30 14:39:13.160: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:39:13.160: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:39:14.160: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:39:14.160: INFO/dun_service(243): Post event 1
05-30 14:39:14.160: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:39:14.160: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:39:15.160: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:39:15.160: INFO/dun_service(243): Post event 1
05-30 14:39:15.170: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:39:15.170: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:39:15.860: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:39:15.860: INFO/dun_service(243): Post event 1
05-30 14:39:15.870: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:39:15.870: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:39:17.170: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:39:17.170: INFO/dun_service(243): Post event 1
05-30 14:39:17.180: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:39:17.180: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:40:07.430: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:40:07.430: INFO/dun_service(243): Post event 1
05-30 14:40:07.430: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:40:07.430: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:40:09.330: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:40:09.330: INFO/dun_service(243): Post event 1
05-30 14:40:09.340: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:40:09.340: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:41:07.840: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:41:07.840: INFO/dun_service(243): Post event 1
05-30 14:41:07.840: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:41:07.840: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:41:09.540: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:41:09.540: INFO/dun_service(243): Post event 1
05-30 14:41:09.551: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:41:09.551: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:41:59.222: ERROR/HierarchicalStateMachine(114): TetherMaster - unhandledMessage: msg.what=3
05-30 14:41:59.222: ERROR/HierarchicalStateMachine(114): TetherMaster - unhandledMessage: msg.what=3
05-30 14:41:59.422: WARN/Smack/Packet(232): notify conn break (IOEx), close connection
05-30 14:41:59.482: INFO/GTalkService(232): [ServiceAutoStarter] --- connectivity changed
05-30 14:41:59.482: INFO/GTalkService(232): [ServiceAutoStarter] --- start GTalk service ---
05-30 14:41:59.532: INFO/MediaUploader(504): No need to wake up
05-30 14:42:06.362: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:06.362: INFO/dun_service(243): Post event 1
05-30 14:42:06.362: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:06.362: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:06.862: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:06.862: INFO/dun_service(243): Post event 1
05-30 14:42:06.872: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:06.872: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:08.372: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:08.372: INFO/dun_service(243): Post event 1
05-30 14:42:08.372: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:08.372: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:08.972: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:08.972: INFO/dun_service(243): Post event 1
05-30 14:42:08.982: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:08.982: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:12.582: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:12.582: INFO/dun_service(243): Post event 1
05-30 14:42:12.592: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:12.592: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:14.392: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:14.392: INFO/dun_service(243): Post event 1
05-30 14:42:14.402: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:14.402: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:15.392: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:15.392: INFO/dun_service(243): Post event 1
05-30 14:42:15.402: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:15.402: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:16.402: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:16.402: INFO/dun_service(243): Post event 1
05-30 14:42:16.402: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:16.402: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:19.312: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:19.312: INFO/dun_service(243): Post event 1
05-30 14:42:19.312: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:19.322: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
05-30 14:42:22.422: INFO/dun_service(243): The value returned from dun_getusbmodemstate_fromsys is 1
05-30 14:42:22.422: INFO/dun_service(243): Post event 1
05-30 14:42:22.432: INFO/dun_service(243): received event: DUN_EVENT_USB_UNPLUG
05-30 14:42:22.432: ERROR/dun_service(243): LG_DATA: Dun Reply Functions [DUN_STATE_USB_UNPLUG --> DUN_STATE_USB_UNPLUG][52]
As per customer's inputs, here is a partial list of devices that exhibit this issue. Unfortunately – we don’t have logs from their beta testers. LG Optimus V (VM670) Android 2.2.2 Motorola Atrix 4G (MB860) Android 2.3.6 Huawei U9000 Android 2.2.2 HTC Evo 4G (PC36100) Android 2.3.3 and Android 2.3.5 Samsung Galaxy Tab 8.9 (GT-P7310) Android 3.2 Droid RAZR Android 2.3.6
I only see traces that show expected behavior. The trace from the LG Ally is showing the application restarting, which happens instead of a black screen / lockup. This occurs after Android has killed off the backgrounded application (i.e., to save memory, etc.) When the user selects to go back to the application, Android tries to re-instate it back to the exact same activity that was showing when it killed it off. We can't support that in Titanium, so we have to restart the app (which is better than sitting at the black screen, which is what would happen if we didn't restart the app). We cannot support that in Titanium because when a Titanium application is re-started, we need it to go through its "normal" lifetime, i.e., starting out with the root activity, since we need to fire up the Javascript runtime and do loads of other things which occur only when the "root activity" runs. The trace from the Razr is showing an app that was **not** killed off by Android, therefore it just comes forward again.
I'll let this hang about a bit before closing it as invalid, in case there are some questions/clarifications.
Customer reported a hang (on the splash screen) in a partial list of devices, will gather logs to provide wider insight around this. Here is a partial list of devices that hang on resume: android 2.3.6 Samsung Galaxy S 4G android 3.2 Galaxy Tab 7.0 Plus android 2.3.4 HTC EVO 3D android 2.3.4 T-Mobile G2 android 2.3.6 Samsung Epic 4G Touch android 2.3.4 HTC EVO 3D android 2.3.4 HTC Droid Incredible android 2.3.4 HTC Merge android 2.3.4 X500 android 2.3.4 HTC Thunderbolt android 2.3.3 DROIDX android 2.3.4 DROID BIONIC android 2.3.5 HTC EVO 4G android 2.3.6 Samsung Galaxy S II android 2.3.4 Samsung Admire android 2.3.6 Motorola Atrix 4G android 2.3.6 Samsung Epic 4G Touch android 2.2.1 Samsung Galaxy S 4G android 2.3.4 Samsung Admire android 2.3.4 HTC Thunderbolt android 2.2.1 Samsung Galaxy S 4G android 2.3.4 HTC EVO 3D android 2.3.3 DROID Pro android 2.3.6 Samsung Replenish android 2.3.6 DROID RAZR android 2.3.5 Samsung Galaxy Prevail android 2.2 LG Optimus T android 2.3.4 HTC Glacier android 2.3.4 HTC Thunderbolt android 2.3.4 HTC EVO 3D
Understood. Can you edit the description? Currently it says "Issue: Once an app has been put into the background after going back (~30 minutes) it restarts." The fact that it restarts is not an issue, if I understand you correctly now. The phone models are not really relevant so no need to add to this list. *We need logs*. I'm happy to give it a few (but only a few) test runs on my phones, but I'll need precisely the same version of the app that others are using who are experiencing this. If I can't reproduce it easily, someone else is going to have to take over the attempts at reproduction.
Edit the description to accurately reflect what their current issue is. I've sent resources to test on some more devices and will be updating this ticket with logs little bit later today.
Tested with a Samsung Galaxy S2 running 2.3.6, it didn't crash, didn't show a black screen and it didn't hang during the splash screen. It restarted the app as normal. Second test: LG Optimus running 2.2.2, it was stuck on the splash screen after trying to relaunch the app after half an hour. Here are the logs for this test: http://pastebin.com/sDBaV17y The SDK I used was 2.0.1GA2 during both tests.
I was able to easily reproduce the splash "hang" issue with Android Emulator for both V8 and Rhino. Same instructions: run the app, dashboard screen appears, navigate to "All Work", press Home button, wait 30mins, open the app again. The splash "hang" is not the actual hang, but the the application is not navigating form the initial splash. It seems to be very connected to the fix made in TIMOB-1911. Then no splash is set, it is effectively black as in TIMOB-1911.
After adding *
This may give some hints on what's going on.
After a long period of inactivity, Android will choose to "restart" the launch activity (what we often call the root activity) and kill off the activities above it. That's what's happening when you see the splash screen (the splash screen is the root activity). Choices: * Use the property max mentions above, which will restart the app (you can safely ignore the message he's shown there regarding the leaked window -- we're killing off the app anyway and forcing a restart.) * Put something like this in near the top of your app.js:
Of course for the latter you'll need to make sure your application code can handle being run a second time without any anomalies. The nice thing about the second option is that it avoids the ugly full application restart (which is very visible) you get if you use the first option.
Bill, I think we should document this behavior in the wiki ? Also, does it make sense to set ti.android.root.reappears.restart=true by default ?
Created a doc ticket for documenting this TIMOB-9523. We can't set that as default because some apps actually use the root activity to show UI (as opposed to it just having the default background which is the "splash".) Such apps don't need to be restarted. This app, however, uses a heavyweight window to display its UI.
cf TIMOB-9523 for us to document what's happening in this scenario.
[~billdawson], that code snippet worked great. Thank you. Also, I really appreciate the reproduction steps (forcing the app closed from settings) as this was hard to reproduce and test before that. Hoping this fix stands the test of time!
I actually still see black screen on resume sometimes. I'm going to try the ti.android.root.reappears.restart property.
Closing ticket as the issue mentioned here is not our bug.