本文整理匯總了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;
}
});
}