Monday, October 10, 2011

[android-developers] Re: how to change the font typeface in PreferenceScreen

you might get lucky via
http://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener.html
as I believe this is called when the preference is first rendered.

And then you can poke the individual preference like so

    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
    Preference pref = findPreference(key);

    if (pref instanceof ListPreference) {
        ListPreference listPref = (ListPreference) pref;
        pref.setSummary(listPref.getEntry());

        String pT = (String) pref.getTitle();
...

Alternatively, if you only have a few preferences, you should be able to address them via their key directly.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment