Problem
When Android force finishes a Titanium Mobile app (after you've gone to run other apps and Android forces your app out of memory), the next attempt to launch the app fails with the "Black Screen of Death". This is just the native nav bar that you see when you start an app, with a totally black screen beneath it. The app will not start, and the "back" button does nothing.
This is a regression, because it did not happen with SDK 1.7.5.
Testcase
Start a new project and paste in the following js files.
Run the app on the emulator.
Press the "Open another window" button.
Press the Android "Home" button.
Monitor logcat with *adb -e logcat | find "WIN DEATH"*
Run other apps that will force Android to kick our app out of memory. Browsing to webpages with lots of content is one way. You might also try going to the Gallery app and viewing images or video.
At some point, your logcat monitor will show that this project was forced finished (the "WIN DEATH" line).
Press the Android "Home" button.
Attempt to open this app again from the applications screen on the emulator (do not re-run the app from Ti Studio).
*You will get the "Black Screen of Death"*. The app will not start, and cannot be backed out of. You have to manually Force Close the app.
var MainWin = Ti.UI.createWindow({url:'win1.js',
navBarHidden:true,
exitOnClose:true,
backgroundColor:'silver'});
MainWin.open();
var MainWin=Ti.UI.currentWindow;
var btn1=Ti.UI.createButton({title:'Open another window'});
function Button1Click()
{
var TiWin = Ti.UI.createWindow({url:'win2.js',
navBarHidden:true,
backgroundColor:'silver'});
TiWin.open();
}
btn1.addEventListener('click',Button1Click);
MainWin.add(btn1);
var lbl1=Ti.UI.createLabel({text:'Now go Home and browse until WIN DEATH',
color:'red',
textAlign:'center'});
Ti.UI.currentWindow.add(lbl1);
Confirmed fixed in SDK 1.8.2.v20120221114636. Thanks Mauro!
Closing since it's a dup.