Hiding an Application's title in Android 4
I was trying to hide an application’s title from the Action bar. The first possible approach was a nasty hack: just setting the label to an empty string, like this
in the Manifest. However, choosing this approach leads you into two problems:
-
The application’s name, below the icon, will be blank
-
You won’t see the app in the “recent apps” list
Googling (for some time) led my to this StackOverflow’s answer. It’s basically what we are looking for, with just a tiny adjustment: we are going to remove the ActionBarSherlock part, since we are using Android 4.0+. So, in the styles.xml
file, the code will look like this:
Of course, our new style needs to be referenced from the Manifest, like this:
That’s it! Hope you’ll find it useful