HelloWorld android blank screen


Starting completely from scratch I tried to get the HelloWorld example to run on my Samsung Galaxy S2.

haxelib install openfl
haxelib run openfl setup
openfl create project HelloWorld
cd HelloWorld
openfl setup android
openfl test android

Everything installed fine and the app installed and launched on my phone. This is the console output.

However, all I see is a white screen.

Then when I close the app with the home button (the others don’t work) and re-open it all I see is a black screen.

What should I do ?

Thanks. Karl

Edit - The white screen is not the problem. Rather it’s the re-opening showing a blank screen. Please see below.

This is what I get when I test with -debug

Not sure what to make of it. Looks like it’s not filtering on the app …

I suppose I should feel embarrassed - Turns out there is no “Hello World” in the HelloWorld example (though don’t you think that is a reasonable expectation ?).

Edit - The white screen isn’t the problem. It’s re-opening showing a blank screen. See below.

I’m still interested in the colour change - When I run the project in Windows it comes out as a white screen. Similarly for android when I initially run ‘test’. However, if I close and re-open the app the screen goes black. This sounds like an issue, right ?

All the best

I think I should have named this post “HelloWorld sample should be named BlankScreen”

In the project.xml is there a <window /> tag with a background="" attribute?
If not then maybe it’s keeping the screen color from before the app, which could be different when launching the app from your computer and from android.
Try adding <window background="0x00FF00" /> to see if that gives a green background.

The project.xml is the same as comes standard - I haven’t changed anything.

No background attribute set - I suppose white is standard ?

Adding the window tag you mentioned did work - it set the background green, in both Windows and android.

However, I still have a problem I mentioned earlier - closing and re-opening the app on my phone results in a black, unresponsive screen.

I should probably create a new thread with the topic “Re-opening android app not working”.

To clarify: If I’m in the app and then press the home button and then re-enter the app by clicking on its icon all I see is black.

I can only get the app back when I close it manually (using the running tasks window and sliding it away) and then clicking the app icon.

I have tried this with another example, DisplayingABitmap, and I get the same result.

Any suggestions ?

Update - Bizarrely if I re-open the app (and hence see a black screen) it comes back up if I press the power button twice.

Presumably this closes and re-opens the running process ?

Note: The preview in the android app selector (holding the home button) isn’t working as well, for HelloWorld or DisplayingBitmap. It’s blank.

Oddly the HelloWorld app preview has a thin green line on the far right side …

Do you have any problems suspending or resuming a sample like PiratePig?

Yikes. PiratePig won’t even start on my phone

Here’s the debug output from when I try launch PiratePig (by clicking the app icon)

Oh, okay, so perhaps the newer code is not handling the suspend/resume for Android yet. This probably works if you build using -Dlegacy?

Yes ! -Dlegacy fixed all the issues. Thanks so much.

Should I log a bug somewhere ?

Also - There also seems to be more wrong with PiratePig and the new code. It wouldn’t even launch without -Dlegacy …