TalkBackPreferencesActivity.java 文件源码

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

项目:talkback 作者:
/**
 * Assigns the appropriate intent to the tutorial preference.
 */
private void assignTutorialIntent() {
    final PreferenceGroup category = (PreferenceGroup) findPreferenceByResId(
            R.string.pref_category_miscellaneous_key);
    final Preference prefTutorial = findPreferenceByResId(R.string.pref_tutorial_key);

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

    final int touchscreenState = getResources().getConfiguration().touchscreen;
    if (touchscreenState == Configuration.TOUCHSCREEN_NOTOUCH) {
        category.removePreference(prefTutorial);
        return;
    }

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


问题


面经


文章

微信
公众号

扫码关注公众号