I want to change the screen layout in my application to full screen when the user click on button but it didn't work, my code is:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnFullScreen = (Button) findViewById(R.id.btnFullScreen);
btnNormalScreen = (Button) findViewById(R.id.btnNormalScreen);
btnFullScreen.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
setTheme(R.style.AppBaseThemeFullScreen);
}
});
btnNormalScreen.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
setTheme(R.style.AppBaseTheme);
}
});
}
And my Full Screen theme is:
<style name="AppBaseThemeFullScreen" parent="android:Theme.Light">
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
</style>
And my Normal theme is
<style name="AppBaseTheme" parent="android:Theme.Light">
<item name="android:windowNoTitle">true</item>
</style>
So if there is any way to do that please help me.