Android device ignores system auto-rotation setting, which can be switched on/off in settings.
If auto-rotate is off, device keeps changing it's orientation.
public void onOrientationChanged(int orientation) function should be modified, it should has code on top, which I provide below.
final ContentResolver resolver = ctx.getContentResolver();
boolean rotateLock = android.provider.Settings.System.getInt(
resolver,
android.provider.Settings.System.ACCELEROMETER_ROTATION, 0) == 1;
if (!rotateLock) {
return;
}
Android device ignores system auto-rotation setting, which can be switched on/off in settings. If auto-rotate is off, device keeps changing it's orientation.
public void onOrientationChanged(int orientation) function should be modified, it should has code on top, which I provide below.
final ContentResolver resolver = ctx.getContentResolver(); boolean rotateLock = android.provider.Settings.System.getInt( resolver, android.provider.Settings.System.ACCELEROMETER_ROTATION, 0) == 1; if (!rotateLock) { return; }