title: getting device orientation in honeycomb
body: <p>The function <strong>SensorManager.getRotationMatrix(...)</strong> does not work in Android 3.0+.  I have run the code below on a wide range of phones/tablets running android 2.x, and it works just fine.</p>
  
  <pre><code>public void onSensorChanged(SensorEvent event) {
      float[] magnetic = event.values;
  
      if( accelerometer != null ) {
          float[] array = new float[9];
  
          SensorManager.getRotationMatrix(array, null, accelerometer, magnetic);
  
          // in 3.0+, 'array' contains all 0's here, which is bad
  
          SensorManager.getOrientation(array, orientation);
      }
  }
  </code></pre>