/**
* Ensure that the vibration setting does not appear on devices without a
* vibrator.
*/
private void checkVibrationSupport() {
Activity activity = getActivity();
if (activity == null) {
return;
}
final Vibrator vibrator = (Vibrator) activity.getSystemService(VIBRATOR_SERVICE);
if (vibrator != null && vibrator.hasVibrator()) {
return;
}
final PreferenceGroup category =
(PreferenceGroup) findPreferenceByResId(R.string.pref_category_feedback_key);
final TwoStatePreference prefVibration =
(TwoStatePreference) findPreferenceByResId(R.string.pref_vibration_key);
if (prefVibration != null) {
prefVibration.setChecked(false);
category.removePreference(prefVibration);
}
}
TalkBackPreferencesActivity.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:talkback
作者:
评论列表
文章目录