TalkBackPreferencesActivity.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:talkback 作者:
/**
 * Assigns the appropriate intent to the label manager preference.
 */
private void assignLabelManagerIntent() {
    final PreferenceGroup category = (PreferenceGroup) findPreferenceByResId(
            R.string.pref_category_touch_exploration_key);
    final Preference prefManageLabels = findPreferenceByResId(
            R.string.pref_manage_labels_key);

    if ((category == null) || (prefManageLabels == null)) {
        return;
    }

    if (Build.VERSION.SDK_INT < LabelManagerSummaryActivity.MIN_API_LEVEL) {
        category.removePreference(prefManageLabels);
        return;
    }

    Activity activity = getActivity();
    if (activity != null) {
        final Intent labelManagerIntent = new Intent(
                activity, LabelManagerSummaryActivity.class);
        labelManagerIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        labelManagerIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        prefManageLabels.setIntent(labelManagerIntent);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号