I have an app that forces screen rotation to landscape (external application controling device over ADB)
I have another app running on my device that have to detect current orientation (portrait/landscape, reverse or not doesn't matter) and do something when device screen orientation change. I have written an OrientationEventListener which works well :
m_orientationEventListener = new OrientationEventListener(this) { @Override public void onOrientationChanged(int orientation) { doSomething() } }; m_orientationEventListener.enable(); My problem : When the screen turns off and then on, the stock ROM rotate the screen to portrait until the screen has been unlocked. ** I neither receive an event when the screen rotates to portraits nor when it rotates back to landscape after unlock **
Any way to listen to this ?
Note: That I have no Activity on screen : i'm running in background and want to detect it from background.
Thanks for your help