In my application, I need to be informed when the orientation of the android device changes. I found two approaches to do that:
Listen to onConfigurationChanged - Using this approach, I get the event when the phone changes from portrait to landscape and vice versa, but I do not get an event when the device changes from 90 degrees to 270 degrees - since in both the cases the orientation is still landscape.
Listen to onOrientationChanged (OrientationEventListener) - This event is getting fired too many times. I just need to know when the device changes between 0, 90, 180 and 270 degrees. I tried using various values for "rate".
Is there third way to achieve what I want? I can share the code if required.
I finally fixed this by handling the events from OrientationEventListener. It fires too many times for comfort but it serves the purpose.