本文整理汇总了Java中android.preference.EditTextPreference.setOnPreferenceClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java EditTextPreference.setOnPreferenceClickListener方法的具体用法?Java EditTextPreference.setOnPreferenceClickListener怎么用?Java EditTextPreference.setOnPreferenceClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.preference.EditTextPreference
的用法示例。
在下文中一共展示了EditTextPreference.setOnPreferenceClickListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.preference.EditTextPreference; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.report_preferences);
getCurrenciesList();
final EditTextPreference pReportReferenceCurrency = (EditTextPreference)getPreferenceScreen().findPreference("report_reference_currency");
pReportReferenceCurrency.setOnPreferenceClickListener(
new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference arg0) {
return showChoiceList(pReportReferenceCurrency);
}
}
);
}
示例2: onCreate
import android.preference.EditTextPreference; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.report_preferences);
getCurrenciesList();
final EditTextPreference pReportReferenceCurrency = (EditTextPreference)getPreferenceScreen().findPreference("report_reference_currency");
pReportReferenceCurrency.setOnPreferenceClickListener(
new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference arg0) {
return pReportReferenceCurrency == null || showChoiceList(pReportReferenceCurrency);
}
}
);
}
示例3: onCreate
import android.preference.EditTextPreference; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preference_connection);
// Read the port and fill in the summary
mPortPreference = (EditTextPreference) getPreferenceScreen()
.findPreference(SharedPreferencesKeys.SP_KEY_PORT);
SharedPreferences sharedPreferences = PreferenceManager
.getDefaultSharedPreferences(getActivity());
String port = sharedPreferences
.getString(SharedPreferencesKeys.SP_KEY_PORT,
String.valueOf(MiamPlayer.DefaultPort));
mPortPreference.setSummary(getString(R.string.pref_port_summary) + " " + port);
mPortPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
EditTextPreference editTextPref = (EditTextPreference) preference;
editTextPref.getEditText().setSelection(editTextPref.getText().length());
return true;
}
});
}