0

Trying to follow something. Boiling down to simplest: In my AndroidManifest.xml I have the following:

<application
 android:allowBackup="true"
 android:configChanges="orientation"
 ...
</application>

In my activity that runs I have this:

@Override
public void onConfigurationChanged(Configuration newConfig) {
    Log.d("PrimesAreInP", "onConfigurationChanged called");
}

However when I change the orientation of the phone from portrait to landscape I never see the onConfigurationChanged() print. What else do I need to do to see this call?

James Webster
  • 31,873
  • 11
  • 70
  • 114
user2399453
  • 2,930
  • 5
  • 33
  • 60

2 Answers2

3

Try adding this for activity tag:

<activity android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboa‌​rdHidden"

Zubair
  • 436
  • 5
  • 13
0

I think you are missing this dude :

super.onConfigurationChanged(newConfig);

and not forget to write this line in activity tag of your menifest :

android:configChanges="orientation|screenSize"

good luck !!!

Sar
  • 550
  • 4
  • 18