Bitmaptext on Android disapears when phone shutdown

im a newbie to android programming and im not sure whats happening

I’ve been experimenting with jme3 on android, and for the most part it’s going pretty well! I just ran with this one issue when making some games. If I add a standart bitmaptext to the guiNode with all of it’s features (color, text, etc.) and run the program on an android device, it’s all good, but if I press the power off button while in the app (so the screen turns off), turn the phone back on and unlock the phone, the problems occur.

The bitmaptext, if on the screen before the power shut off, will disappear completely. Gone. If it wasen’t bitmap text, but instead a picture, it would do one of the things.

  1. Disappear completely like the bitmap text if it was on the screen before the powershut

  2. If it wasen’t on the screen before the power shutoff (if it wasen’t attached to guiNode) and then shows after the power-on, the image becomes looks corrupted, looking grey with a bit of a tilt.

I’m not really sure what’s causing this, but this problem doesn’t happen if you open the apps preview button (the one where you get to see a box of every app open on your phone) and then do the powershut off trick. This also affects the FPS and Statview, but the grey box is not affected.

I’ll update this thread with photos and info once I can get them on my pc :slight_smile:

EDIT: I’m starting to think the whole main class is being restarted, because if I play with AudioNode, it plays the audio twice. Also, everything I said doesn’t always happen. :confused:

Note: 3D objects in the rootNode are not affected from what ive seen

I’m using this as a template for android studio

Example of picture corruption below

Screenshot_2019-01-17-17-49-08

1 Like

Hi there,
I have also noticed this and it seems to only happen if your game runs in landscape orientation.

I first thought it has to do with my code but noticed it on the stats view as well.

Please keep us informed of your findings.

Thanks

Here’s an update on the situation.

USE BELOW PHOTO FOR REFRENCE ON WHAT IT’S SUPPOSED TO LOOK LIKE

I noticed that this bug also occurs not just with the power off trick, but if your android device (in this case, I used an 8.0) and you use the multitask function, which is the one where you are able to use multiple apps at once, the error also occurs, as seen below.

Also, yes. This only occurs in landscape mode. I’m still stumped on this situation. Maybe some experienced monkeys that used android can help out?

I googled about this on LibGdx (as it is more commonly used for android than JME) and was able to find similar issues, hope it help to narrow down the problem.

https://github.com/libgdx/libgdx/issues/870

https://github.com/flixel-gdx/flixel-gdx/issues/33

https://www.badlogicgames.com/wordpress/?p=1073