views:

65

answers:

1

In an Android application I am writing, the styling for my various TextView elements is defined in an xml resource. I would like enable the user to change certain styles such as android:typeface using a PreferenceActivity.

Is there a way to modify a style resource programmatically such that all associated widgets will update correctly? If not, must I manually select all widgets by id and change their styling?

A: 

Don't know whether you've found it but the Cubewallpaper sample uses preferences and that appears to do it all by hand in the onSharedPreferenceChanged event.

You can keep the preference keys in a resource file but that's about it it would appear.

FixerMark
I've realised already that I can use the `onSharedPreferenceChanged` callback to notify my `Activity` that the preferences have been changed. My problem is that I don't know how to change a style defined in an xml resource which is used by many widgets.
Leo