title: How to set screen size to full screen at runtime in android
body: <p>I want to change the screen layout in my application to full screen when the user click on button but it didn't work, <strong>my code</strong> is:</p>
  
  <pre><code>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);
  
          }
      });
  
  
  
  }
  </code></pre>
  
  <p>And my <strong>Full Screen theme</strong> is:</p>
  
  <pre><code>&lt;style name="AppBaseThemeFullScreen" parent="android:Theme.Light"&gt;
      &lt;item name="android:windowFullscreen"&gt;true&lt;/item&gt;
      &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And my <strong>Normal theme</strong> is</p>
  
  <pre><code>&lt;style name="AppBaseTheme" parent="android:Theme.Light"&gt;
      &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>So if there is any way to do that please help me.</p>