获取自动旋转信息在Android上 [英] Get Auto-Rotate Information On Android
本文介绍了获取自动旋转信息在Android上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为Android应用程序,因为我想知道自动旋转是否启用。有谁知道我能得到这个?所以,仅仅是为了清楚:我只需要知道用户是否已经在其设置中启用与否自动旋转
I am working on an app for Android, for which I would like to know whether or not Auto-Rotate is enabled. Does anybody know how I can get this? So just for clarity: I only need to know whether or not a user has Auto-Rotate enabled in their settings or not.
推荐答案
您可以自动旋转方式开启/关闭使用 Settings.System.ACCELEROMETER_ROTATION
为:
You can Get Auto-Rotate Information On/Off Using Settings.System.ACCELEROMETER_ROTATION
as :
if (android.provider.Settings.System.getInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1){
Toast.makeText(Rotation.this, "Rotation ON", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(Rotation.this, "Rotation OFF", Toast.LENGTH_SHORT).show();
}
这篇关于获取自动旋转信息在Android上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文