Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 102  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Android 3.2 remove title from action bar
  2. @Override
  3. public void onCreate(Bundle savedInstanceState)
  4. {
  5.     ActionBar actionBar = getActionBar();
  6.     actionBar.setDisplayShowTitleEnabled(false);
  7.     actionBar.setDisplayShowHomeEnabled(false);
  8.     super.onCreate(savedInstanceState);
  9.     setContentView(R.layout.test);
  10. }
  11.        
  12. <activity android:name=".ActivityHere"
  13.      android:label="">
  14.        
  15. <resources>
  16.     <style name="ActionBar.CustomTheme" parent="@android:style/Widget.Holo.ActionBar"/>
  17.     <style name="CustomTheme" parent="@android:style/Theme.Holo">
  18.         <item name="android:actionBarStyle">@style/ActionBar.CustomTheme</item>
  19.     </style>
  20. </resources>
  21.        
  22. <application
  23.   android:theme="@style/CustomTheme
  24.   ...
  25.  
  26. <activity
  27.   android:name="MainActivity"
  28.   android:theme="@android:style/Theme.Holo.NoActionBar">
  29.   ...
  30.        
  31. @Override
  32. public void onCreate()(Bundle savedInstanceState)
  33. {
  34.     super.onCreate(savedInstanceState);
  35.     setTheme(R.style.CustomTheme); // Set the custom theme which has the action bar.
  36.     ActionBar actionBar = getActionBar();
  37.     ...