The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Android game doesn't resume correctly
Bytenjoy


Joined: 03 May 2015
Posts: 1
Hi, I have found what may be a bug in 2.0.3 and 2.0.4-9582. The steps to reproduce the bug are:

1. Open the game from Play Store (e.g. you just installed the game and click the open button).

Code:

V/SDL     (13884): Device: GT-P1000
V/SDL     (13884): Model: GT-P1000
V/SDL     (13884): onCreate():null
V/SDL     (13884): onResume()
V/SDL     (13884): surfaceCreated()
V/SDL     (13884): surfaceChanged()
V/SDL     (13884): pixel format RGB_565
V/SDL     (13884): Window size:600x1024
I/SDL     (13884): SDL_Android_Init()
I/SDL     (13884): SDL_Android_Init() finished!
V/SDL     (13884): onWindowFocusChanged(): true


2. Press the home button. The game enters background.

Code:

V/SDL     (13884): onPause()
V/SDL     (13884): nativePause()
V/SDL     (13884): onWindowFocusChanged(): false
V/SDL     (13884): surfaceDestroyed()


3. Open the game by clicking the icon instead of from Play Store.

Code:

V/SDL     (13944): Device: GT-P1000
V/SDL     (13944): Model: GT-P1000
V/SDL     (13944): onCreate():game.agilemath.Activity@4052b728
V/SDL     (13944): onResume()
V/SDL     (13944): surfaceCreated()
V/SDL     (13944): surfaceChanged()
V/SDL     (13944): pixel format RGB_565
V/SDL     (13944): Window size:600x1024
I/SDL     (13944): SDL_Android_Init()
I/SDL     (13944): SDL_Android_Init() finished!
V/SDL     (13944): onWindowFocusChanged(): true


4. The screen goes blank and events aren't handled by the game (e.g. I press back button but nothing happens, it should exit the game).

If at the first step I open the game by clicking the icon instead of from Play Store I can resume without problem. I'm testing the game in a Galaxy Tab and Android 2.3.3.
AntTheAlchemist


Joined: 13 Feb 2015
Posts: 60
Location: UK
I'm experiencing the same problem with 2.0.3. It doesn't happen every time for me though? I'm hoping it's fixed in 2.0.4, since there have been a lot of tweaks since.
Android game doesn't resume correctly
slvn


Joined: 06 Oct 2012
Posts: 88
You might want to try this patch :
https://bugzilla.libsdl.org/show_bug.cgi?id=2774
(only the last message/patch-v2 is relevant)

It's about screen been distorted when resuming from background.

That happens with samsung device with old version of android:
"onSurfaceChanged is called with permuted width / height.
The path is just to skip this invalid call and wait for the next call
to "onSurfaceChanged" with correct values.

I have been using it for 6 months no with no issue.


On 5 May 2015 at 17:51, AntTheAlchemist wrote:
Quote:
I'm experiencing the same problem with 2.0.3. It doesn't happen every time
for me though? I'm hoping it's fixed in 2.0.4, since there have been a lot
of tweaks since.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
Sylvain Becker
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org