[TIMOB-1964] Android: kitchensink opens on a blank window after being backgrounded and device sleeps.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-07-08T09:36:34.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2011-22, Release 1.7.2 |
Components | Android |
Labels | android, background, defect, reported-1.4.0, rplist, sleep, tbs-1.7.1 |
Reporter | Thomas Huelbert |
Assignee | Opie Cyrus |
Created | 2011-04-15T03:06:40.000+0000 |
Updated | 2013-05-10T19:53:13.000+0000 |
Description
pastie of logcat:
http://pastie.org/1192004">http://pastie.org/1192004
I've sen this a few times recently.
1.Launch KS (seen on a G1 running 1.6).
2.background it, let the device fall asleep for some time (more
than a few minutes anyway)
3.wake device, launch app from app drawer
results: blank window with "kitchen sink" header. Pressing the back button quits the app (next launch will show the app splash)
Attachments
File | Date | Size |
---|---|---|
AndroidManifest.xml | 2011-05-31T13:39:45.000+0000 | 3104 |
Moving to 1.5.1 as per Don
First step is to get a reproduction sequence and determine cause. This may take more than one milestone to fix.
Still don't have a good reproduction sequence.
Duplicates
Commit:
https://github.com/appcelerator/titanium_mobile/commit/566bdf31b8916b7323fc01fd98ecfedf8b83d2a6"> https://github.com/appcelerator/titanium_mobile/commit/566bdf31b891...
This is caused by Android telling the Activities to restart without finishing. Our lifecycle implementation can't currently handle that, and a much bigger ticket will be created for that. In the meantime, to get past the blank screen, we detect this and simply restart the app.
In my testing, it actually took several hours to "fall asleep", so to speak -- i.e, to be in the background long enough for Android to tell the activities to restart the next time the user brings the application forward. In order to save testing time, you can re-create a failcase and test the fix by doing something else on the device (either emulator or handset) which leads Android to do this special "restart without finish" sequence which we were failing to handle. Namely, you can change the language of the device.
Follow these steps to test:
Launch Kitchen Sink
After KS loads, press the device Home button to keep Kitchen Sink running in the background.
Go to Settings - Language and Keyboard (whatever it's called) and change the language, i.e., from English to Spanish.
After the language has been changed, press and hold the device's Home button to show the list of recently used apps, then select KitchenSink. In the failcase you'll get a (mostly) blank screen. After my changes, the app should simply restart.
Sounds great Bill! How does the detection work?
I'm getting a white screen most of the time, so I hope it's got nothing to do with colour. ;)
Yeah, I should've said "blank". :) It's not related to colour. It simply detects that Android is asking the application's Android Activities to destroy & restart without "finishing" (isFinishing() == false).
I downloaded the build from Apr 12 2011 11:18 r61371d3f and it's still not working for my project. Neither when waiting for a while or changing the language.
Using the latest build from April 15th and still get the issue when the app is clicked on after being in the background for a few hours. There is a notable change though. It used to have a blank screen, now it displays the splash screen and seems to hang until you press the back button. I've used KS and a simple demo app to test. It doesn't seem App related. Is it possible that it gets catch in the restart Bill mentions? It seems like it is trying to restart but getting locked somehow. Tested on a Nexus S with 2.3
[INFO] Titanium SDK version: 1.7.0 (05/03/11 10:31 41a577e) Verified with Nexus S with Android OS 2.3.2, Galaxy Tab with 2.2.1, Droid with 2.2.1, and the emulator running 2.1.
reopened issue as per Bill/Don pastie link to logcat pulled from droid1 http://pastie.org/1862127
Issue can be resolved by adding 'android:alwaysRetainTaskState="true"' to the root activity for the application in a custom AndroidManifest.xml and including that in the
Example AndroidManifest.xml for KitchenSink that resolves black screen
moving to sprint 22
Tested with 1.7.2.v20110706211037 on Droid 2.2.1 and Nexus one 2.2.2
I'm seeing this in my apps as well. I just downloaded Kitchen Sink and experienced the same issue. This was using SDK 1.8.0.1 and the device was a Motorola Xoom.