tags:

views:

15

answers:

0

I have implemented the onPreferenceClick(Preference) callback interface

    public boolean onPreferenceClick(Preference arg0) {

 if (arg0 instanceof ListPreference){
  addListPreferenceEntriesFromStore((ListPreference) arg0, getSharedPreferences("cfn_preferences", MODE_PRIVATE));
 }

 else if (arg0 instanceof EditTextPreference){
  ((EditTextPreference)arg0).setTitle("Hallabalooo");
  ((EditTextPreference)arg0).setDialogTitle("Tjillevipp");
 }

 return true;
}

When I tap the EditTextPreference for the first time the title, in the PreferenceScreen, is changed as expected but the dialog title isn't. The second time I tap the EditTextPreference the dialog title is also updated.

I experience the same behaviour with the ListPreference. The addListPreferenceEntriesFromStore() method updates the contents of the ListPreference, but the change isn't visible the first time the ListPreference is displayed.

It seems like changes made to the dialog part of a preference during the context of the onPreferenceClick() callback doesn't show.

What is it I do wrong here? Or is there a workaround?

Thankful for any help

/Mathias