title: Android: Detect Device Orientation Change
body: <p>In my application, I need to be informed when the orientation of the android device changes. I found two approaches to do that:</p>
  
  <ol>
  <li><p>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.</p></li>
  <li><p>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".</p></li>
  </ol>
  
  <p>Is there third way to achieve what I want? I can share the code if required.</p>