Android Hide Title Bar and Full Screen ExampleIn this example, we are going to explain how to hide the title bar and how to display content in full screen mode. 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. Code that hides title bar of activityThe getSupportActionBar() method is used to retrieve the instance of ActionBar class. Calling the hide() method of ActionBar class hides the title bar. Code that enables full screen mode of activityThe 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. Android Hide Title Bar and Full Screen ExampleLet's see the full code to hide the title bar in android. activity_main.xmlFile: activity_main.xml
Activity classFile: MainActivity.java
Output: Hiding the Title Only![]() Output: Hiding the TitleBar and enabling FullScreen![]()
Next TopicAndroid Screen Orientation Example
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week