In my manifest file I specified android:configChanges="orientation". And I noticed that when turning off the screen while in landscape the onConfigurationChanged() method is called once with portrait status and then called again with landscape status when waking up the screen.
What is the reason for this ? Is there any way to disable it ?
The problem seems related to the lock screen which forces the layout back to portrait when switching screen off/on.
I solved my issue by ignoring calls to
onConfigurationChanged()between the calls toonPause()andonResume()