In Android we can hide the title bar and run our app in full screeb view.
To Do this we will use requestWindowFeature(Window.FEATURE_NO_TITLE)
The requestWindowFeature(Window.FEATURE_NO_TITLE) method of Activity must be called to hide the title. But, it must be coded before the setContentView method.
To Do this we will use requestWindowFeature(Window.FEATURE_NO_TITLE)
The requestWindowFeature(Window.FEATURE_NO_TITLE) method of Activity must be called to hide the title. But, it must be coded before the setContentView method.
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);//will hide the title not the title bar
- setContentView(R.layout.activity_main);
- }
- }
he setFlags() method of Window class is used to display content in full
screen mode. You need to pass the
WindowManager.LayoutParams.FLAG_FULLSCREEN
constant in the setFlags method.
- equestWindowFeature(Window.FEATURE_NO_TITLE);
- //code that displays the content in full screen mode
- this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);//int flag, int mask
- setContentView(R.layout.activity_main);
Hi,
ReplyDeleteThanks for sharing the information with us it was very informative. Hangup.in