I\'m using ActionBarSherlock and I\'m trying to hide the title bar of my application but whenever I do that, I get a NullPointerException
when accessing the A
to hide all the title bar and keep only the action bar use this code:
final ActionBar actionBar = getActionBar();
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayUseLogoEnabled(false);
it worked for me
see this answer to grammatically show/hide titleBar from the ActionBarSherlock ..
android: title bar hide
Arci's answer is not entirely correct. If you read the Theming documentation, you can find that:
The themes should be defined in your manifest for the entire application or on a per-activity basis. You may also define the theme in the code of each activity before calling
super.onCreate(Bundle)
. This must be done for every activity on which you extend from one of the 'Sherlock' activity base classes and intend to use the action bar.
In other words it would be enough for you to swap the first two lines of your original code:
setTheme(R.style.Theme_Sherlock);
super.onCreate(savedInstanceState);
...
If you are using Xamarin. You can use below.
ActionBar.Hide();