Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app title bar doesn't show when testing the app?

I'm creating an app, and when I build it and start it on my phone (a Sony Xperia Z1 with Android 4.4.4), the title bar doesn't show. All activities is rendered without the title bar, like this:

enter image description here

I'm using Android Studio, and in the editor, the title bar is visible. It just don't work when the app is being ran.

All help with this is appreciated!

like image 656
Daniel Kvist Avatar asked Jan 06 '15 21:01

Daniel Kvist


People also ask

Which method is used to hide the activity title?

The requestWindowFeature(Window. FEATURE_NO_TITLE) method of Activity must be called to hide the title.

How do I add an action bar?

To add actions to the action bar, create a new XML file in your project's res/menu/ directory. The app:showAsAction attribute specifies whether the action should be shown as a button on the app bar.


Video Answer


1 Answers

Update to this answer. ActionBarActivity was deprecated as of version 22.1.0. To achieve this same outcome, extend AppCompatActivity.

ActionBarActivity API Class Reference

like image 146
Akash Magoon Avatar answered Oct 10 '22 22:10

Akash Magoon