本文整理汇总了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");
}