Tag: android-actionbar

AppCompat – Item not showing in action bar for API levels v8-13

I have one item I want to always display in the action bar using the AppCompat library. It’s just a sub menu using the default overflow image. This is not working for me on API levels v8-13 and I’ve done everything the developer guide says, including adding my own namespace. I’m using a custom style […]

Android: ActionBarSherlock search widget

I currently have an application in the play store for both tablets and smartphone runnings Android 3.0+ (http://tinyurl.com/cnejnjs). In order to appeal to more users I am looking into getting the application to work on a large range of devices. I am aware of ActionBar Sherlock and this seems to do almost everything I want. […]

How to change programmatically background color of action bar items

It is easy to set a default color of the items background in action bar by setting: <item name=”android:actionBarItemBackground”>@drawable/action_bar_item_background</item> in application theme. I would like to change this color only for one of my fragments. How to do it programmatically?

Android Custom Theming in ActionBar/Tabs

I have the theme Holo.Light.DarkActionBar The tabs are now set to white background, light gray text–very unreadable. I simply want to change the text to something much, much darker. I have searched the styles to see if I can override but all I can do is change the background, not the text. Can I do […]

Remove ActionBar subtitle / Reset ActionBar text

I’m currently setting the ActionBar subtitle on certain pages, but on some pages i don’t want to have a subtitle. I can simply set the text of the subtitle to nothing, but this just removes the text. It still occupies the subtitle space and thus pushes the title up. It can be hard to explain, […]

How to style ActionaBar Tab text in Android?

I am using ActionBarShrelock to provide Action Bars for pre honeycomb devices. I have following code in my themes.xml file… <style name=”My.Tab.Style” parent=”@android:style/Widget.TabWidget”> <item name=”android:textAppearance”>@style/MyCustomTabTextStyle</item> </style> <style name=”MyCustomTabTextStyle” parent=”Widget.Sherlock.ActionBar.TabText”> <item name=”android:textAppearance”>@android:style/TextAppearance.Medium</item> <item name=”android:textSize”>14sp</item> <item name=”android:textStyle”>bold</item> <item name=”android:textColor”>@color/tabbar_text_color</item> </style> Than I use this it as <item name=”android:actionBarTabTextStyle”>@style/My.Tab.Style</item> <item name=”actionBarTabTextStyle”>@style/My.Tab.Style</item> Can any one explain why I am […]

ActionBarSherlock: open submenu with menu button

I’m using ActionBarSherlock-4.1.0-0 and I would like to open my submenu in the Actionbar with the hardware menu button. I’m planing an update and in my old version I used the “normal” menu. I’d like to help users to get used to the new design. I got the submenu and the main-menu: @Override public boolean […]

ActionBar list navigation: different text color in header and pop up menu

I have a navigation list in my action bar that has a dark background. The pop menu however, has a white background. So what I want to achieve is, that the item text color inside of the action bar is white whereas the items text color in the menu pop up are black. This are […]

NullPointerException: with ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference

strong textI get this nullPointerException on runtime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)’ on a null object reference code from mainActivity: package com.example.vasilis.spangreek; import android.app.ActionBar; import android.app.Activity; import android.content.res.Configuration; import android.content.res.TypedArray; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.util.DisplayMetrics; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ExpandableListView; import java.util.ArrayList; […]

getActionBar from Fragment with AppCompatLibrary

I’m look for the easiest way to get an ActionBar instance from a Fragment using AppCompatLibrary and API 8. Already tried things like getActivity().getSupportActionBar() but no luck.

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.