Thursday, 26 September 2013

hide Title Bar in Android

// siddhu vydyabhushana // 3 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

3 comments:

  1. 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.
    wholesale shawls , wholesale pashmina , pashmina shawl wholesale , pashminas in bulk , wholesale scarves in bulk , wholesale scarf suppliers , chiffon scarves wholesale , wholesale prayer shawls , velvet shawls wholesale , velvet shawl

    ReplyDelete