Android and orientation change handling?

Hello,
is there anything special about handling orientation change in android? How would I handle that?

My test app works OK, and handles pause/resume OK. But when the orientation changes (and SDL emits SDL_QUIT event), i exit my APP, which is then restarted by the system, and then some things work (like my textures showing images), while others do not (virtual keyboard, or shapes drawn with SDL_gpu). I have to kill the app and restart it to get the keyboard and shapes visible again.

(How) Can I ignore orientation change request from within the application (so the screen will not rotate and the app will not get the quit event)?

Regards,
miko

I don’t do anything to handle orientation changes at all.
You just have to specify orientation hints in SDL_SetHint() and it
should work automatically. No exiting the app etc, should be necessary.On 11/30/2013 7:47 AM, miko wrote:

Hello,
is there anything special about handling orientation change in
android? How would I handle that?

My test app works OK, and handles pause/resume OK. But when the
orientation changes (and SDL emits SDL_QUIT event), i exit my APP,
which is then restarted by the system, and then some things work (like
my textures showing images), while others do not (virtual keyboard, or
shapes drawn with SDL_gpu). I have to kill the app and restart it to
get the keyboard and shapes visible again.

(How) Can I ignore orientation change request from within the
application (so the screen will not rotate and the app will not get
the quit event)?

Regards,
miko


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Pallav Nawani
Game Designer/CEO
http://www.ironcode.com
Twitter: http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming

Are you specifying how your app handles orientation changes in your
AndroidManifest.xml?

As an example, I use these in my “activity” tag to disable portrait
orientation: android:configChanges="keyboardHidden|orientation"
android:screenOrientation=“sensorLandscape”

Jonny DOn Fri, Nov 29, 2013 at 9:33 PM, Pallav Nawani wrote:

I don’t do anything to handle orientation changes at all.
You just have to specify orientation hints in SDL_SetHint() and it should
work automatically. No exiting the app etc, should be necessary.

On 11/30/2013 7:47 AM, miko wrote:

Hello,
is there anything special about handling orientation change in android?
How would I handle that?

My test app works OK, and handles pause/resume OK. But when the
orientation changes (and SDL emits SDL_QUIT event), i exit my APP, which is
then restarted by the system, and then some things work (like my textures
showing images), while others do not (virtual keyboard, or shapes drawn
with SDL_gpu). I have to kill the app and restart it to get the keyboard
and shapes visible again.

(How) Can I ignore orientation change request from within the application
(so the screen will not rotate and the app will not get the quit event)?

Regards,
miko


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Pallav Nawani
Game Designer/CEO
http://www.ironcode.com
Twitter: http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Jonny D wrote:

Are you specifying how your app handles orientation changes in your AndroidManifest.xml?

As an example, I use these in my “activity” tag to disable portrait orientation: android:configChanges=“keyboardHidden|orientation” android:screenOrientation=“sensorLandscape”

Jonny D

Thanks, that was the cause! Thank you very much!

I suggest adding this info to README-android.txt to help other unexperienced android developers like me. I was debugging my code, while the cause was android app configuration.