Skip to main content
Inspiring
Sep 1, 2017 12:15 AM UTC
Question

Black screen on Android when returning from sleep

I found a few posts - most quite old - this one appeared to have resolved the issue for some:

https://forum.starling-framework.org/topic/air-18-black-screen-after-standby-on-android#post-82165

Nothing worked for me - I did figure out a workaround though:

Add a listener in your main Context:

NativeApplication.nativeApplication.addEventListener(flash.events.Event.ACTIVATE , activateHandler);

In the handler - add a dummy object like a button to the stage (you can set its alpha to 0) then simply remove it after a quarter second.  The removal of the object appears to kick the display back on.  Note, if you try to remove the object too quickly, the display will stay black.

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

Known Participant
Mar 22, 2018 3:25 PM UTC

doing  if(stage) stage.quality = stage.quality, onActivate event does fix this issue.

weird after more than 1 year still not fixed by adobe air

we encounter this issue only on Android 8 Oreo

but the workaround still works thanks !

Translate
mohammado59081064
Participant
Aug 27, 2018 10:18 PM UTC

i have tried all the solutions up there and no one solve me the issue, i am still getting black screen when back from sleep state at Samsung Galaxy S8, here is my ACTIVATE code:

private function AppActiveHandler(e:Event):void

{

if(game_ != null)

{

game_.AppActiveHandler();

}

if(starling_ != null)

{

starling_.start();

}

// sometimes after activating the app (in very rare cases) the render is stopped

// this is the workaround to avoid this scenario.

if (nativeStage_ != null)

{

//var quality:String = nativeStage_.quality;

nativeStage_.quality = StageQuality.BEST

var q:Quad = new Quad(starling_.stage.width, starling_.stage.height);

q.x = 0;

q.y = 0;

starling_.stage.addChild(q);

Starling.juggler.delayCall(function ():void

{

starling_.stage.removeChild(q);

}, 0.25);

}

}

please suggest how should i solve this issue?

thanks.

Translate
Colin Holgate
Inspiring
Aug 28, 2018 12:00 AM UTC

There may be some things worth trying mentioned in this discussion:

context lost « Starling Forum

Check what Daniel suggests.

If things are still bad, and especially if you can make a demo file for them to check, you could raise an issue in GitHub:

GitHub - Gamua/Starling-Framework: The Cross Platform Game Engine 

Translate
Colin Holgate
Inspiring
Sep 1, 2017 12:32 AM UTC

I can imagine cases where setting the stage quality to what it already is, might not do anything. On deactivate I do:

stage.quality = "low";

and on activate:

stage.quality = "medium";

Now, if you're entirely using Stage3D you can get away with a stage quality of "low", so you could do the reverse of what I do.

Translate
dewsAuthor
Inspiring
Sep 1, 2017 12:41 AM UTC

This was the answer I found in the old posts - but it didn't work for me - only adding and removing an object fixed the issue.

Translate
Colin Holgate
Inspiring
Sep 1, 2017 12:44 AM UTC

The post you linked to did a stage.quality = stage.quality, which is different to the way I do it.

Then again, I'm doing a lot of display list things, so that might be why it works for me.

Translate