Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2819] Android: "Black Screen of Death" occurs when Android kills app, then relaunch it

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2012-02-22T10:44:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, defect, regression
ReporterShawn Lipscomb
AssigneeMauro Parra-Miranda
Created2012-02-22T09:51:29.000+0000
Updated2016-03-08T07:47:45.000+0000

Description

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);

Comments

  1. Mauro Parra-Miranda 2012-02-22

  2. Shawn Lipscomb 2012-02-22

    Confirmed fixed in SDK 1.8.2.v20120221114636. Thanks Mauro!
  3. Mauro Parra-Miranda 2013-11-24

    Closing since it's a dup.

JSON Source