当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceScreen.setTitle方法代码示例

本文整理汇总了Java中android.preference.PreferenceScreen.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceScreen.setTitle方法的具体用法?Java PreferenceScreen.setTitle怎么用?Java PreferenceScreen.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.preference.PreferenceScreen的用法示例。


在下文中一共展示了PreferenceScreen.setTitle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateLinks

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
private void updateLinks(boolean force) {
    List<OTALink> links = LinkConfig.getInstance().getLinks(getActivity(), force);
    for (OTALink link : links) {
        String id = link.getId();
        PreferenceScreen linkPref = (PreferenceScreen) getPreferenceScreen().findPreference(id);
        if (linkPref == null && mLinksCategory != null) {
            linkPref = getPreferenceManager().createPreferenceScreen(getActivity());
            linkPref.setKey(id);
            mLinksCategory.addPreference(linkPref);
        }
        if (linkPref != null) {
            String title = link.getTitle();
            linkPref.setTitle(title.isEmpty() ? id : title);
            linkPref.setSummary(link.getDescription());
        }
    }
}
 
开发者ID:DroidThug,项目名称:VulcanOTA,代码行数:18,代码来源:SlimOTAFragment.java

示例2: onCreate

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
@Override
public void onCreate(final Bundle icicle) {
    super.onCreate(icicle);
    setHasOptionsMenu(true);
    setInputMethodSettingsCategoryTitle(R.string.language_selection_title);
    setSubtypeEnablerTitle(R.string.select_language);
    addPreferencesFromResource(R.xml.prefs);
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    preferenceScreen.setTitle(
            ApplicationUtils.getActivityTitleResId(getActivity(), SettingsActivity.class));
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:SettingsFragment.java

示例3: addScreen

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
private PreferenceScreen addScreen(String title, Preference parent){
    PreferenceScreen s = getPreferenceManager().createPreferenceScreen(this);
    s.setTitle(title);
    if (parent instanceof PreferenceScreen){
      ((PreferenceScreen) parent).addPreference(s);
    }else if (parent instanceof PreferenceCategory){
        ((PreferenceCategory) parent).addPreference(s);
    }
    return s;
}
 
开发者ID:iebb,项目名称:Kasumi,代码行数:11,代码来源:AppPreferences.java

示例4: passwordListAvailable

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
@Override
public void passwordListAvailable(int count) {
    resetList(PREF_CATEGORY_SAVED_PASSWORDS);
    mNoPasswords = count == 0;
    if (mNoPasswords) {
        if (mNoPasswordExceptions) displayEmptyScreenMessage();
        return;
    }

    displayManageAccountLink();

    PreferenceCategory profileCategory = new PreferenceCategory(getActivity());
    profileCategory.setKey(PREF_CATEGORY_SAVED_PASSWORDS);
    profileCategory.setTitle(R.string.section_saved_passwords);
    profileCategory.setOrder(ORDER_SAVED_PASSWORDS);
    getPreferenceScreen().addPreference(profileCategory);
    for (int i = 0; i < count; i++) {
        PasswordUIView.SavedPasswordEntry saved =
                mPasswordManagerHandler.getSavedPasswordEntry(i);
        PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(getActivity());
        String url = saved.getUrl();
        String name = saved.getUserName();
        screen.setTitle(url);
        screen.setOnPreferenceClickListener(this);
        screen.setSummary(name);
        Bundle args = screen.getExtras();
        args.putString(PASSWORD_LIST_NAME, name);
        args.putString(PASSWORD_LIST_URL, url);
        args.putInt(PASSWORD_LIST_ID, i);
        profileCategory.addPreference(screen);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:33,代码来源:SavePasswordsPreferences.java

示例5: passwordExceptionListAvailable

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
@Override
public void passwordExceptionListAvailable(int count) {
    resetList(PREF_CATEGORY_EXCEPTIONS);
    mNoPasswordExceptions = count == 0;
    if (mNoPasswordExceptions) {
        if (mNoPasswords) displayEmptyScreenMessage();
        return;
    }

    displayManageAccountLink();

    PreferenceCategory profileCategory = new PreferenceCategory(getActivity());
    profileCategory.setKey(PREF_CATEGORY_EXCEPTIONS);
    profileCategory.setTitle(R.string.section_saved_passwords_exceptions);
    profileCategory.setOrder(ORDER_EXCEPTIONS);
    getPreferenceScreen().addPreference(profileCategory);
    for (int i = 0; i < count; i++) {
        String exception = mPasswordManagerHandler.getSavedPasswordException(i);
        PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(getActivity());
        screen.setTitle(exception);
        screen.setOnPreferenceClickListener(this);
        Bundle args = screen.getExtras();
        args.putString(PASSWORD_LIST_URL, exception);
        args.putInt(PASSWORD_LIST_ID, i);
        profileCategory.addPreference(screen);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:28,代码来源:SavePasswordsPreferences.java

示例6: onActivityCreated

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    addPreferencesFromResource(R.xml.spell_checker_settings);
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    preferenceScreen.setTitle(ApplicationUtils.getActivityTitleResId(
            getActivity(), SpellCheckerSettingsActivity.class));
    TwoStatePreferenceHelper.replaceCheckBoxPreferencesBySwitchPreferences(preferenceScreen);

    mLookupContactsPreference = (SwitchPreference) findPreference(
            AndroidSpellCheckerService.PREF_USE_CONTACTS_KEY);
    turnOffLookupContactsIfNoPermission();
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:14,代码来源:SpellCheckerSettingsFragment.java

示例7: onCreate

import android.preference.PreferenceScreen; //导入方法依赖的package包/类
@Override
public void onCreate(final Bundle icicle) {
    super.onCreate(icicle);
    setHasOptionsMenu(true);
    setInputMethodSettingsCategoryTitle(R.string.language_selection_title);
    setSubtypeEnablerTitle(R.string.select_language);
    addPreferencesFromResource(R.xml.prefs);
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    preferenceScreen.setTitle(
            ApplicationUtils.getActivityTitleResId(getActivity(), SettingsActivity.class));
    if (!ProductionFlags.ENABLE_ACCOUNT_SIGN_IN) {
        final Preference accountsPreference = findPreference(Settings.SCREEN_ACCOUNTS);
        preferenceScreen.removePreference(accountsPreference);
    }
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:16,代码来源:SettingsFragment.java


注:本文中的android.preference.PreferenceScreen.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。