Showing posts with label title bar. Show all posts
Showing posts with label title bar. Show all posts

Thursday, 26 September 2013

hide Title Bar in Android

// siddhu vydyabhushana // 5 comments
When you developing application some times Title Bar is looking awkward, so we have to remove it.Title bar will represents that what activity is running.

To remove TitleBar single line code we have to use within onCreate method.

Syntax:

requestWindowFeature(Window.FEATURE_NO_TITLE);
 

Show your application in the Mode of FullScreen

Use setFlags to show your application in fullscreen.

Syntax:

this.getWindow().setFlags(flags, mask);
 

Full Code:

@Override
protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
  //to hide TitleBar
  requestWindowFeature(Window.FEATURE_NO_TITLE);

//for FULL SCREEN  
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
  setContentView(R.layout.activity_main);
 }
 

Output:

hide titlebar in android
Read More