0

So I have this under my Activity's onCreateView()

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);

And my manifest looks like this

    <activity
        android:name="com.example.nfcproducttracing.ProductTracer"
        android:label="@string/app_name" 
        android:theme="@android:style/Theme.Holo.Light"
        android:launchMode="singleTask">

What I have achieved is have my application with Tabs, but no TitleBar. However, during application launch I can briefly see the TitleBar before it disappears, and I do not want that.

What am I supposed to do? When I set my activity theme to anything related to NoTitle, getActionBar returns null and the app crashes.

hermann
  • 6,109
  • 11
  • 45
  • 66

3 Answers3

0

If I understand correctly your questions, you can use the requestWindowFeature(Window.FEATURE_NO_TITLE) from your activity.

Flag for the "no title" feature, turning off the title at the top of the screen.

MikeL
  • 5,103
  • 40
  • 41
0

Not really sure but have you tried this:

getActionBar().setTitle("");

It will set a blank title for your ActionBar.

Mike
  • 1,000
  • 1
  • 10
  • 18
0

You can try using getSupportActionBar() instead. this is from android.support.v4.app.actionbar, not from android.app.actionbar!

ZygD
  • 10,844
  • 36
  • 65
  • 84