Search code examples
androidandroid-layoutandroid-preferences

How to set Preference preferenceInformationStyle from code?


A preference style can be set like this:

<Preference
    android:key="my_pref"
    style="?android:preferenceInformationStyle" />

Is there a way to apply the same style dynamically from Java?


Solution

  • You cannot set a view's style programmatically. Probably below solution will help: android set style in code