Androidアプリケーションを実行して回転を修正するとすぐに回転しようとしています。Settings.System.ACCELEROMETER_ROTATIONそれは回転させませんただ回転機能を有効にするだけで、あなたの助けが必要です(^ _ ^)。ここに私のコードは次のとおりです。Androidスクリーンの回転、ACCELEROMETER_ROTATION
`
TableRow tableRow;
Time HourProgram;
RotateAnimation r;
int H = 12000, M = 1200;
int averageConsultationTime = 30;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.table);
setAutoOrientationEnabled(this, true);
}
public static void setAutoOrientationEnabled(Context context,
boolean enabled) {
Log.i("OK", "setAutoOrientationEnabledOK");
Settings.System.putInt(context.getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION, enabled ? 1 : 0);
}
public static boolean getRotationScreenFromSettingsIsEnabled(Context context) {
int result = 0;
try {
result = Settings.System.getInt(context.getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
}
return result == 1;
}
`
を与える[この](http://stackoverflow.com/a/18268304/2900127) – 7geeky
活動はあなたので、Androidのではデフォルトで回転してみてください*あなたのデバイスで*自動回転*オプションが有効になっていることを確認する必要があります。 –