Fix NPE if there is no accelerometer.

Change-Id: I983290a7fc3deda2a82b03ff564f1b7201cc3dd3
This commit is contained in:
Dianne Hackborn
2010-10-05 18:54:49 -07:00
parent 5a5fff7101
commit b499bb1069

View File

@@ -109,7 +109,9 @@ public abstract class WindowOrientationListener {
}
public void setAllow180Rotation(boolean allowed) {
mSensorEventListener.setAllow180Rotation(allowed);
if (mSensorEventListener != null) {
mSensorEventListener.setAllow180Rotation(allowed);
}
}
public int getCurrentRotation(int lastRotation) {