/**
* Assigns the appropriate intent to the keyboard shortcut preference.
*/
private void assignKeyboardShortcutIntent() {
final PreferenceGroup category =
(PreferenceGroup) findPreferenceByResId(
R.string.pref_category_miscellaneous_key);
final Preference keyboardShortcutPref = findPreferenceByResId(
R.string.pref_category_manage_keyboard_shortcut_key);
if ((category == null) || (keyboardShortcutPref == null)) {
return;
}
if (Build.VERSION.SDK_INT < KeyComboManager.MIN_API_LEVEL) {
category.removePreference(keyboardShortcutPref);
return;
}
Activity activity = getActivity();
if (activity != null) {
final Intent labelManagerIntent = new Intent(activity,
TalkBackKeyboardShortcutPreferencesActivity.class);
labelManagerIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
labelManagerIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
keyboardShortcutPref.setIntent(labelManagerIntent);
}
}
TalkBackPreferencesActivity.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:talkback
作者:
评论列表
文章目录