Jugwancommunication

Follow Us:

  • Home
  • News
  • FreeSoftware
  • OperatingSystem
  • ComptureLanguage
  • _Python
  • Faridabad Job's
HomeShortCode

Android Hide Title Bar and Full Screen Example

byYogesh Rajput -May 11, 2021
0

File: activity_main.xml

<?xml version="1.0" encoding="utf-8"?>  

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"  

    xmlns:app="http://schemas.android.com/apk/res-auto"  

    xmlns:tools="http://schemas.android.com/tools"  

    android:layout_width="match_parent"  

    android:layout_height="match_parent"  

    tools:context="first.ugstuff.com.hidetitlebar.MainActivity">  

  

    <TextView  

        android:layout_width="wrap_content"  

        android:layout_height="wrap_content"  

        android:text="Hello World!"  

        app:layout_constraintBottom_toBottomOf="parent"  

        app:layout_constraintLeft_toLeftOf="parent"  

        app:layout_constraintRight_toRightOf="parent"  

        app:layout_constraintTop_toTopOf="parent" />  

  

</android.support.constraint.ConstraintLayout>   


Activity class

File: MainActivity.java




package first.javatpoint.com.hidetitlebar;  

  

import android.support.v7.app.AppCompatActivity;  

import android.os.Bundle;  

import android.view.Window;  

import android.view.WindowManager;  

  

public class MainActivity extends AppCompatActivity {  

  

    @Override  

    protected void onCreate(Bundle savedInstanceState) {  

        super.onCreate(savedInstanceState);  

        requestWindowFeature(Window.FEATURE_NO_TITLE); //will hide the title   

        getSupportActionBar().hide(); // hide the title bar  

        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  

               WindowManager.LayoutParams.FLAG_FULLSCREEN); //enable full screen  

        setContentView(R.layout.activity_main);  

    }  

}  


Output: Hiding the Title Only


android hide title bar example output 1

Tags: ShortCode
  • Share on Facebook
  • Share on Twitter
You might like

If you have any doubts. Please Let me Know

Post a Comment

If you have any doubts. Please Let me Know

Post a Comment (0)

Previous Post Next Post

Follow Us

Advertisement

Main Tags

  • 16 GB RAM
  • 512GB SSD
  • 8 GB RAM
  • BestComputerCourses
  • Dell MS116 1000DPI USB Wired Optical Mouse
  • Excel
  • faridabadjob
  • Free_Software
  • HP 15 (2021) Thin & Light 11th Gen Core i5 Laptop
  • HP Pavilion (2021) Thin & Light 11th Gen Core i5 Laptop
  • Iris Xe Graphics
  • Java
  • JavaScript
  • MSOffice
  • Python
  • ShortCode
  • windows
  • Wired Keyboard and Mouse Combo with 104 Keys and a USB Mouse with

Featured post

Yogesh RajputSeptember 18, 2021

Advertisement

Tags

  • 16 GB RAM
  • 512GB SSD
  • 8 GB RAM
  • BestComputerCourses
  • Dell MS116 1000DPI USB Wired Optical Mouse
  • Excel
  • faridabadjob
  • Free_Software
  • HP 15 (2021) Thin & Light 11th Gen Core i5 Laptop
  • HP Pavilion (2021) Thin & Light 11th Gen Core i5 Laptop
  • Iris Xe Graphics
  • Java
  • JavaScript
  • MSOffice
  • Python
  • ShortCode
  • windows
  • Wired Keyboard and Mouse Combo with 104 Keys and a USB Mouse with

Pages

  • Terms and Conditions
  • Contact Us
  • JavaScriptTutorial
  • Today News

Advertisement

Contact Form