當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。