當前位置: 首頁>>代碼示例>>Java>>正文


Java Preference.setTitle方法代碼示例

本文整理匯總了Java中android.support.v7.preference.Preference.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java Preference.setTitle方法的具體用法?Java Preference.setTitle怎麽用?Java Preference.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.preference.Preference的用法示例。


在下文中一共展示了Preference.setTitle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreatePreferences

import android.support.v7.preference.Preference; //導入方法依賴的package包/類
@Override
public void onCreatePreferences(Bundle bundle, String s) {
    addPreferencesFromResource(R.xml.preferences);
    mPreferenceHelper = ((REDApplication) getActivity().getApplication()).getComponent().preferencesHelper();
    Preference versionPreference = findPreference("pref_verion_name");
    versionPreference.setTitle(BuildConfig.VERSION_NAME);
}
 
開發者ID:stuxo,項目名稱:REDAndroid,代碼行數:8,代碼來源:SettingsFragment.java

示例2: onUserGet

import android.support.v7.preference.Preference; //導入方法依賴的package包/類
@Override
public void onUserGet(TraktGson.TraktUser user, Drawable icon) {
    Preference pref = findPreference(getString(R.string.pref_key_login));
    if(pref != null && user != null) {
        pref.setTitle("Logged in as: " + user.username);
        pref.setSummary("Click for re-outh");
        if(icon != null) {
            pref.setIcon(icon);
        }

    }
}
 
開發者ID:ad-on-is,項目名稱:chilly,代碼行數:13,代碼來源:SettingsFragment.java

示例3: onViewCreated

import android.support.v7.preference.Preference; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
    super.onViewCreated(view, savedInstanceState);
    app = (App) getContext().getApplicationContext();
    setYearAdapters();
    view.setBackgroundColor(Color.parseColor("#FFFFFF"));
    Preference preference = findPreference("preference_logout");
    preference.setOnPreferenceClickListener(onLogout);
    Preference year = findPreference("preference_staticyear");
    year.setOnPreferenceClickListener(onStaticYear);
    Preference test = findPreference("preference_notification");
    test.setOnPreferenceClickListener(onNotificationsOpen);
    Preference about = findPreference("preference_about");
    about.setOnPreferenceClickListener(onAbout);
    Preference shortcut = findPreference("preference_shortcut");
    shortcut.setOnPreferenceClickListener(onTheme);
    Preference shortcut1 = findPreference("preference_webmail");
    shortcut1.setOnPreferenceClickListener(onTheme1);
    Preference tys = findPreference("preference_tys");
    tys.setOnPreferenceClickListener(onTySRequest);

    String type = "release";
    if (AppManager.isDebug())
        type = "debug";

    Preference version = findPreference("preference_version");
    version.setTitle("ConnectU App version " + AppManager.getAppVersion(getContext()));
    version.setSummary("You are on " + type + " mode");
}
 
開發者ID:Onelio,項目名稱:ConnectU,代碼行數:31,代碼來源:PreferenceMenuFragment.java


注:本文中的android.support.v7.preference.Preference.setTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。