Android 中Locale,auto-rotate状态的获取

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);

猜你喜欢

转载自guojianhui0906.iteye.com/blog/1176827