Orientation Changes

When you change the orientation of your Android phone from, say, portrait to landscape, it can cause problems. I avoided these problems by inserting the following into the activity tag:

android:configChanges="orientation|keyboardHidden"

Note that “keyboardHidden” is required; it is intimately tied to orientation.

Also, add this to the Java class:

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
    	super.onConfigurationChanged(newConfig);
    }
Advertisements
Published in: on January 18, 2012 at 6:15 pm  Leave a Comment  

The URI to TrackBack this entry is: https://sestoelemento.wordpress.com/2012/01/18/orientation-changes/trackback/

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: