Victor Oliveira Victor Oliveira - 1 year ago 110
Android Question

onConfigurationChanged not getting called even with manifest config changes - Why?

I know the question is awful, done thousands of times ; But seriously, I've been stuck for 4 hours trying to solve this. I came into every link from 2009 until today and all of them give the same solution which (**** knows why) is not applying into my case.

This is the activity inside my manifest:


I'm using SDKs 4.0 or higher:

android:targetSdkVersion="19" />

And this is my class:

public class CamerasActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {


VideoView videoView = (VideoView)findViewById(;

//Still not working
public void onConfigurationChanged(Configuration newConfig) {

Log.d("System.out", "Welcome to Landscape Mode");
else if(newConfig.orientation==Configuration.ORIENTATION_PORTRAIT)
Log.d("System.out", "Welcome to portrait mode");

When I run my app like this I can see in portrait mode, works fine. if I use
on my manifest, I can see forced in landscape mode. This means my layouts are fine but why exactly my
isn't getting called when I try to rotate the screen? What am I missing?


AVD Config:

enter image description here

Auto-Rotate enabled:
enter image description here

Video the way it is:
enter image description here
And no outputs on my logcat.

Answer Source

The onConfigurationChanged method is called when you physically rotated an Android device. So, you need to rotate your device to see the method gets called.

Note: The onConfigurationChanged also gets called when you changed locale, etc. See here for more info.

Also, I would have these values for the android:configChanges directive:


Also, Issue 61671 might be related to the screen orientation problem described in this post. As of April 2014, this defect / bug has not been resolved by Google.


As stated in this SO link, screen orientation might work if the device type is set as a generic 7" tablet instead of Nexus 7.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download