Android: Remove title/notifications bar programmatically


/ Published in: Java
Save to your folder(s)

There are roughly three ways to do this: programatically, through stylesheets, or through the Anroid manifest.


Copy this code and paste it in your HTML
  1. public class MainActivity extends Activity {
  2. /** Called when the activity is first created. */
  3. @Override
  4. public void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. setContentView(R.layout.main);
  7.  
  8. //Remove title bar
  9. this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  10.  
  11. //Remove notification bar
  12. this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  13.  
  14. }
  15. }

URL: http://stackoverflow.com/questions/2591036/how-to-hide-the-title-bar-for-an-activity-in-xml-with-existing-custom-theme

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.