Showing posts with label Orientation. Show all posts
Showing posts with label Orientation. Show all posts

Android - App restart and lose all its states when keyboard is opened

I have an application that I just would like to use in portrait mode, so I have defined android:screenOrientation="portrait" in the manifest XML. This works OK for the HTC magic phone (and prevents orientation changes on other phones as well).

But I have a problem with the HTC G1 phone as i open the hardware qwerty keyboard (not the virtual keyboard). My activity stays in portrait mode, but seems to get restarted and loses all its states. This does not happen with the hero version.

My application is quite big so I don't want it to restart and lose all its states when the keyboard is opened. Any idea on how I can prevent that?

Android - How to disable landscape mode

How can I disable landscape mode for some of the views in my Android app?

Popular Posts