I want to programmatically change the text color of all ListPreference in my PreferenceActivity, after the layout is constructed (so after onCreate). Basically I want to be able to toggle all text between black and white.

I've tried having two themes for both colors, but that requires to restart the activity to toggle between themes. I don't want that.

Can someone come up with a solution to this problem?

有帮助吗?

解决方案

I guess the answer to my question is that there is no way to do what I wanted. I ended up using two themes for both colors, even though changing the theme will apply after restarting the activity.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top