Guest User

Untitled

a guest
Apr 28th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  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. ...
Advertisement
Add Comment
Please, Sign In to add comment