Locale,auto-rotate状态的获取

来源:互联网 发布:陈建仁访问梵蒂冈'知乎 编辑:程序博客网 时间:2024/05/20 23:35

 

1. 得到当前locale:

Context.getResources().getConfiguration.locale;

 

 

2. 是否开启了auto-rotate:(这个和具体设备似乎也有关系,不确定是否通用)

 

import android.provider.Settings;
mAutoRotateSwitch = (Settings.System.getInt(this.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0) == 1);

 

 

 

其他有些状态不经常用,想起来再更新:)