title: How to make an appliacation go to fullscreen with a botton
body: <p>I search about this and this what i find</p>
  
  <p>the code to make an application go to full screen is this</p>
  
  <pre><code>int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN ;
  
  View decorView = getWindow().getDecorView();
  decorView.setSystemUiVisibility(uiOptions);
  </code></pre>
  
  <p>But when i put it in a button it doesn't work</p>
  
  <p>My findings about the problems</p>
  
  <p>The code only works when View is visible
  You only can make it go to fullscreen every 1000 ms
  The aplication clear automatically the flags when go to other part in the phone
  My objective is to make the app go to full screen in all activities but i want to Know how it works the code above i search in the source code an i couldn't find a solution</p>
  
  <p>The code above it works only when i upload the code to the phone</p>