Is it possible to change the background of a sub screen (PreferenceScreen) of a PreferenceActivity?

StackOverflow https://stackoverflow.com/questions/4729169

Question

I found that you can change the background of a PreferenceActivity by using getListView().setBackgroundResource(R.drawable.bg);

However, if you go to any deeper PreferenceScreens the background returns to being black.

There don't appear to be any methods in PreferenceScreen that would allow changes to the background either.

Was it helpful?

Solution

The nested PreferenceScreens are supposed to take the theme from the parent however due to this bug http://code.google.com/p/android/issues/detail?id=4611&q=preference%20nested&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars they don't and I don't know of how to set the background manually in the nested preference. Hopefully this helps at least explain why.

Would love to hear if you find a workaround :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top