Code example for EditTextPreference

Methods: setTitle, getEditText

0
	public boolean onPreferenceClick(Preference preference) {
		// TODO Auto-generated method stub 
        Log.i("ProfileFragment", "onPreferenceClick----->"+String.valueOf(preference.getKey()));  
        lastClickedPreference = preference;
        if (namePreference == preference) {
			namePreference.setTitle(namePreference.getEditText().getText().toString());
		} 
		return true; 
	}   
 
	@Override 
	public void onSharedPreferenceChanged(SharedPreferences preference, String arg1) {
		// TODO Auto-generated method stub 
		//if(lastClickedPreference.getKey().equals(ringtonePreference.getKey())) 
		 
		if( lastClickedPreference instanceof AudioPickerPreference){
			Log.i("ProfileFragment", "onPreferenceChange----->"+String.valueOf(preference.getInt(lastClickedPreference.getKey(), -1)));  
 
		} 
		else if (lastClickedPreference == namePreference) {
			namePreference.setTitle(preference.getString(namePreference.getKey(), ""));