I\'m trying to change the theme for the PreferenceActivity in my app and I just can\'t get it to work.
This is the xml:
At last i found out how to change theme of "PreferenceActivity" programmatically(via java code)
To change theme just do like this:
@Override
public void onCreate(Bundle savedInstanceState) {
setTheme(R.style.Holo_Theme_Light);
super.onCreate(savedInstanceState);
}
Always call setTheme(R.style.yourtheme);
method before super.onCreate(savedInstanceState);
method. By doing this it will produce result as shown below.
That's all.
If yo call setTheme(R.style.yourtheme);
method after super.onCreate(savedInstanceState);
method it will produce result as shown below.
Note: Themes are not recognize by nested PreferenceScreen. To apply theme to that nested PreferenceScreen you have to make an another PreferenceActivity for that nested PreferenceScreen and call setTheme(R.style.yourtheme);
method there.