If want to make an activity to fullscreen in some cases like playing video in fullscreen mode, playing game etc., you can do that by following one of the methods.

Method 1

One way is using Theme.Holo.Light.NoActionBar.Fullscreen value in AndroidManifest.xml file. (Use the appropriate theme name whichever you used in your application)

<activity android:name=".MainActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
Method 1

Another way is, do this through code in the activity. In your activity do the following before calling setContentView() function

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                                WindowManager.LayoutParams.FLAG_FULLSCREEN);        

setContentView(R.layout.activity_main);
Author

Ravi is hardcore Android programmer and Android programming has been his passion since he compiled his first hello-world program. Solving real problems of Android developers through tutorials has always been interesting part for him.

  • Comrade Hadi

    Thanks

  • chethan

    hi Guys, i am using splash screen activity for
    Android Tab Layout with Swipeable Views which i got here
    i want to use intent for the image which place in the top rated fragment activity which goes to a url… how do i do it? can anyone help me in this

  • /user

    /user

  • john

    Great one

  • I am using the programmatic way to implement the No Title Bar feature but it is not fast enough when you click on the back button on my phone at times you can see a glimpse or flash of the activity with the title bar and all. I am working on a splash screen with an image, after which the apps mainactivity loads with the title bar. What could be the problem?

  • Raihan Rian

    is it possible to use this code in case of tab bar navigation?
    i am using your tab bar tutorial with swipe view.
    i want to remove the app title bar nut when i use it stopped and show unfortunately stopped.

  • mahesh

    hi sir after register the form we will get six digit code to mobile how

  • Bunthoeurn Dim

    Hi guy! I don’t know why when I try to hide the menu bar, it becomes not response. I use it with Android 5.0.1.

  • velu

    Thanks….bro

  • Fernando Antonio

    im follow your site for 1 year, always is helpful, thanks for all post tutorials xD

  • Vinod Devgan

    1.Go to your manifest.xml file.

    2.Find the activity tag for which you want to hide your ActionBar and then add,

    android:theme=”@style/Theme.AppCompat.NoActionBar”

    • a

      I LOVE YOU THANKS SO MUCH

  • uday govind pathak

    thank u sir ,its amegine

  • uday govind pathak

    thanku sir……

  • Anatoli Eidelman (AskTolik)

    Great tips and tricks about how to make android apps titles, Keywords, Image. Amazing sites 🙂

    http://bit.ly/1JWTLXV

  • vinod

    it’s good. can we write tile in telugu language in action bar.?????

  • Aboki

    This is great!!!

  • Yash Vadhvani

    the app automatically opens and closes help me