本文整理了Java中android.support.v7.preference.Preference.getKey()
方法的一些代码示例,展示了Preference.getKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Preference.getKey()
方法的具体详情如下:
包路径:android.support.v7.preference.Preference
类名称:Preference
方法名:getKey
暂无
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public boolean onPreferenceTreeClick(Preference preference) {
if (preference.getKey().equals(captionSettingsKey) && CAPTIONING_SETTINGS_ACCESSIBLE) {
startActivity(new Intent(Settings.ACTION_CAPTIONING_SETTINGS));
}
return super.onPreferenceTreeClick(preference);
}
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public boolean onPreferenceTreeClick(Preference preference) {
if (DEBUG) {
Log.d(TAG, "onPreferenceTreeClick() called with: preference = [" + preference + "]");
}
if (preference.getKey().equals(DOWNLOAD_PATH_PREFERENCE)
|| preference.getKey().equals(DOWNLOAD_PATH_AUDIO_PREFERENCE)) {
Intent i = new Intent(getActivity(), FilePickerActivityHelper.class)
.putExtra(FilePickerActivityHelper.EXTRA_ALLOW_MULTIPLE, false)
.putExtra(FilePickerActivityHelper.EXTRA_ALLOW_CREATE_DIR, true)
.putExtra(FilePickerActivityHelper.EXTRA_MODE, FilePickerActivityHelper.MODE_DIR);
if (preference.getKey().equals(DOWNLOAD_PATH_PREFERENCE)) {
startActivityForResult(i, REQUEST_DOWNLOAD_PATH);
} else if (preference.getKey().equals(DOWNLOAD_PATH_AUDIO_PREFERENCE)) {
startActivityForResult(i, REQUEST_DOWNLOAD_AUDIO_PATH);
}
}
return super.onPreferenceTreeClick(preference);
}
代码示例来源:origin: udacity/ud851-Exercises
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// Figure out which preference was changed
Preference preference = findPreference(key);
if (null != preference) {
// Updates the summary for the preference
if (!(preference instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(preference.getKey(), "");
setPreferenceSummary(preference, value);
}
}
}
代码示例来源:origin: udacity/ud851-Exercises
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// Figure out which preference was changed
Preference preference = findPreference(key);
if (null != preference) {
// Updates the summary for the preference
if (!(preference instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(preference.getKey(), "");
setPreferenceSummary(preference, value);
}
}
}
代码示例来源:origin: udacity/ud851-Exercises
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// Figure out which preference was changed
Preference preference = findPreference(key);
if (null != preference) {
// Updates the summary for the preference
if (!(preference instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(preference.getKey(), "");
setPreferenceSummary(preference, value);
}
}
}
代码示例来源:origin: hidroh/materialistic
@Implementation
public void persistString(String value) {
persistedString = value;
PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application)
.edit()
.putString(realObject.getKey(), value)
.apply();
}
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public boolean onPreferenceTreeClick(Preference preference) {
if (preference.getKey().equals(thumbnailLoadToggleKey)) {
final ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.stop();
imageLoader.clearDiskCache();
imageLoader.clearMemoryCache();
imageLoader.resume();
Toast.makeText(preference.getContext(), R.string.thumbnail_cache_wipe_complete_notice,
Toast.LENGTH_SHORT).show();
}
return super.onPreferenceTreeClick(preference);
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
代码示例来源:origin: udacity/ud851-Sunshine
@Override
public void onCreatePreferences(Bundle bundle, String s) {
// Add 'general' preferences, defined in the XML file
addPreferencesFromResource(R.xml.pref_general);
SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
PreferenceScreen prefScreen = getPreferenceScreen();
int count = prefScreen.getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference p = prefScreen.getPreference(i);
if (!(p instanceof CheckBoxPreference)) {
String value = sharedPreferences.getString(p.getKey(), "");
setPreferenceSummary(p, value);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!