I am trying to change Theme of my application on button click. I have defined an onClick() function in my Activity.
My code:
public class Screen2 extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.secondscreen);
}
public void theme(View view){
getApplication().setTheme(android.R.style.Theme_Holo);
}
It doesn’t work. Could you please help me to change theme of my application?
Thanks in Advance.
Here is the nice tutorial for changing the theme on
Button clickand also Here is the tutorial for the Styling Android With Defaults