本文整理汇总了Java中android.preference.PreferenceCategory.setKey方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceCategory.setKey方法的具体用法?Java PreferenceCategory.setKey怎么用?Java PreferenceCategory.setKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.preference.PreferenceCategory
的用法示例。
在下文中一共展示了PreferenceCategory.setKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCategory
import android.preference.PreferenceCategory; //导入方法依赖的package包/类
private PreferenceCategory addCategory(String title, PreferenceScreen screen, String key, Drawable icon, Context context) {
PreferenceCategory c = new PreferenceCategory(context);
c.setTitle(title);
if (null != key) c.setKey(key);
if (null != icon) c.setIcon(icon);
screen.addPreference(c);
return c;
}
示例2: passwordListAvailable
import android.preference.PreferenceCategory; //导入方法依赖的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);
}
}
示例3: passwordExceptionListAvailable
import android.preference.PreferenceCategory; //导入方法依赖的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);
}
}
示例4: build
import android.preference.PreferenceCategory; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public PreferenceCategory build() {
PreferenceCategory category = new PreferenceCategory(mContext);
category.setKey((String) getRequiredAttribute(BUNDLE_KEYATTR_KEY));
category.setTitle((CharSequence) getRequiredAttribute(BUNDLE_TITLE_KEY));
return category;
}
示例5: passwordListAvailable
import android.preference.PreferenceCategory; //导入方法依赖的package包/类
@Override
public void passwordListAvailable(int count) {
resetList(PREF_CATEGORY_SAVED_PASSWORDS);
resetList(PREF_CATEGORY_SAVED_PASSWORDS_NO_TEXT);
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);
}
}
示例6: passwordExceptionListAvailable
import android.preference.PreferenceCategory; //导入方法依赖的package包/类
@Override
public void passwordExceptionListAvailable(int count) {
resetList(PREF_CATEGORY_EXCEPTIONS);
resetList(PREF_CATEGORY_SAVED_PASSWORDS_NO_TEXT);
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);
}
}