Search

Saturday, February 12, 2011

A short tip: Avoid rotation

If you want to avoid the screen rotate automatically, simply put:

android:screenOrientation="portrait"

or
android:screenOrientation="landscape"

In the definition view.

If you prefer the programatically option:

setRequestedOrientation(
               ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)

or
setRequestedOrientation(
               ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)


It's very simple, It isn't?

No comments:

Post a Comment