本文整理匯總了Java中android.preference.PreferenceScreen.setSummary方法的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceScreen.setSummary方法的具體用法?Java PreferenceScreen.setSummary怎麽用?Java PreferenceScreen.setSummary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.preference.PreferenceScreen
的用法示例。
在下文中一共展示了PreferenceScreen.setSummary方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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());
}
}
}
示例2: 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);
}
}