Skip to main content
Inspiring
May 10, 2014
Answered

Reporting: Adobe Air - Black Screen Bug Spotted

  • May 10, 2014
  • 1 reply
  • 3001 views

Basically, my latest android app got rejected during a certification process due to a black screen popping up after triggering the alarm.

This is my error report that I received from the store:

Black screen appears after alarm

<Procedure>
1. Launch application
2. 'Start' > Play game > Alarm show up > End alarm > Check

<Expected Result>
Black screen should not appear

So all you have to do is create a new android project in air with nothing but a white background, set the orientation to horizontal, check the full screen option, export and install the app, run the app, minimize the app and open the clock app and set an alarm, go back to the app, wait for the alarm, then cancel the alarm once it pops up, and what you get is a black screen.


Interestinly enough, the background music plays in the background, admob ads work as well, only the screen goes black, but once we minimize the app and then go back to it again, everything's fine. Moreover, when the app is in a vertical mode, the black screen doesn't appear.


Additional info: Apps developed in Flash Professional with the use of Air 4.0. Tested on android 4.3 & 4.4.

Unfortunately, I won't be able to upload android air apps until the problem gets fixed .

This topic has been closed for replies.
Correct answer Colin Holgate

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl_Activate(event:Event=null):void {

stage.quality = "low";

}

private function fl_Deactivate(event:Event):void {

stage.quality = "medium”;

}

For our apps we use the stage quality of “low”, which uses less memory, and when the app is deactivated the quality is switched to “medium”, then back to “low” when activated again.

That’s enough to make the textures reload.

1 reply

Colin Holgate
Colin HolgateCorrect answer
Inspiring
May 10, 2014

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl_Activate(event:Event=null):void {

stage.quality = "low";

}

private function fl_Deactivate(event:Event):void {

stage.quality = "medium”;

}

For our apps we use the stage quality of “low”, which uses less memory, and when the app is deactivated the quality is switched to “medium”, then back to “low” when activated again.

That’s enough to make the textures reload.

Mark.fromOP
Inspiring
September 11, 2014

Colin is a genius.