Questions tagged [android-actionbar]

The ActionBar is Android's window feature that identifies the application and user location, and provides user actions and navigation modes.

The action bar is a window feature at the top of the activity that may display the activity title, navigation modes, and other interactive items.

You should use the action bar in most activities that need to prominently present user actions or global navigation, because the action bar offers users a consistent interface across applications and the system gracefully adapts the action bar's appearance for different screen configurations. You can control the behaviors and visibility of the action bar with the ActionBar APIs, which were added in Android 3.0 (API level 11) but support library as well as various independent libraries provide the ActionBar for lower API versions.

With android 5.0, a new design, called Material Design, replace the ActionBar by a new element, Toolbar.

References

  1. UI guide for ActionBar
  2. ActionBar patterns
  3. Class APIs - ActionBar
  4. Support Library
  5. Class APIs - Support Library Action Bar
  6. Toolbar replace the ActionBar
8891 questions
597
votes
27 answers

Display Back Arrow on Toolbar

I'm migrating from ActionBar to Toolbar in my application. But I don't know how to display and set click event on Back Arrow on Toolbar like I did on Actionbar. With ActionBar, I call mActionbar.setDisplayHomeAsUpEnabled(true). But there is no…
591
votes
27 answers

This Activity already has an action bar supplied by the window decor

Trying to move over my stuff to use Toolbar instead of action bar but I keep getting an error saying java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tyczj.weddingalbum/com.xxx.xxx.MainActivity}:…
374
votes
26 answers

How do I hide a menu item in the actionbar?

I have an action bar with a menuitem. How can I hide/show that menu item? This is what I'm trying to do: MenuItem item = (MenuItem) findViewById(R.id.addAction); item.setVisible(false); this.invalidateOptionsMenu();
Stir Zoltán
  • 4,033
  • 3
  • 16
  • 14
366
votes
31 answers

Can't Find Theme.AppCompat.Light for New Android ActionBar Support

I am trying to implement the new ActionBar support library that was released by Google a couple days ago. In the past, I have successfully implemented ActionBarSherlock without any issues using the same method listed on Google Developer's Support…
330
votes
15 answers

Full Screen Theme for AppCompat

I would like to know how can I apply full screen theme ( no title bar + no actionbar ) to an activity. I am using AppCompat library from support package v7. I've tried to applied android:theme="@android:style/Theme.NoTitleBar.Fullscreen" to my…
Ye Lin Aung
  • 11,234
  • 8
  • 45
  • 51
312
votes
28 answers

ActionBar text color

how can I change the text color of the ActionBar? I've inherited the Holo Light Theme, I'm able to change the background of the ActionBar but I don't find out what is the attribute to tweak to change the text color. Ok, I'm able to change the text…
302
votes
20 answers

How do I change the background color of the ActionBar of an ActionBarActivity using XML?

Details: I'm extending ActionBarActivity. Eclipse and SDK fully patched as of 2011-11-06. Deployed to Samsung device with Android 2.3.3 Application has…
user77115
  • 5,517
  • 6
  • 37
  • 40
284
votes
15 answers

What is the size of ActionBar in pixels?

I need to know the exact size of ActionBar in pixels so to apply correct background image.
Eugene
  • 59,186
  • 91
  • 226
  • 333
269
votes
17 answers

How to Set a Custom Font in the ActionBar Title?

How (if possible) could I set a custom font in a ActionBar title text(only - not the tab text) with a font in my assets folder? I don't want to use the android:logo option.
user742030
258
votes
20 answers

How to change the text on the action bar

Currently it just displays the name of the application and I want it to display something custom and be different for each screen in my app. For example: my home screen could say 'page1' in the action bar while another activity that the app switches…
dootcher
  • 3,059
  • 4
  • 22
  • 18
247
votes
17 answers

How do I change the android actionbar title and icon

I'm trying to do some things on the ActionBar in Android. I've already added new items in the right side of the action bar. How can I change the left side of the action bar? I want to change the icon and the text, and I want to add a "Back Button"…
Allan Ramírez
  • 2,689
  • 2
  • 17
  • 15
245
votes
27 answers

How to hide action bar before activity is created, and then show it again?

I need to implement splash screen in my honeycomb app. I use this code in activity's onCreate to show splash: setContentView(R.layout.splash); getActionBar().hide(); and this code to show main UI after…
Ilya Izhovkin
  • 3,455
  • 4
  • 22
  • 25
219
votes
14 answers

Remove shadow below actionbar

I use actionbarsherlock. The piece of code below is responsible for changing it's background to a custom one.