本文整理匯總了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);
}
示例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);
}
}
}
示例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");
}