Tag: android-actionbar

change action bar direction to right-to-left

I’m creating an android app for a right-to-left specific language. And I’m using ActionBarSherlock (a compatible android action bar library). The thing I exactly want is how to change the direction of action bar to RTL even the user not sets the default Locale an RTL language. If anyone has an idea even for standard […]

Action Bar Tabs do not fill screen width

I have an action bar with two tabs underneath. It looks alright in most smartphones, but in tablets or the nexus 4, for example, the tabs do not stretch to occupy the whole width of the screen. Here’s a screenshot (taken on a Nexus 4): As can be seen, there are two black bars to […]

ActionBarSherlock setCustomView not working in Android 3.2

I recently upgraded my application to use ActionBarSherlock 4.1. Since the upgrade users running the app on Honeycomb experiance a force close due to a null pointer exception when setting a custom view on the actionbar. I add a custom view containing two spinners to the actionbar this works on Android 4.0 & 4.1 but […]

Android ActionBar hide/show when scrolling list view

I want to hide/show the compatibility action bar as the user scrolls up/down a listview. When the action bar disappears the list will occupy also the action bar’s space. I’ve followed an approach but it generates an ugly flickering. Does anyone have a proper solution for this problem? The desired behaviour is like the hide/show […]

ActionBar pre Honeycomb

I am writing an app for android (2.1 > 3.1) and I would like to use the familiar practice of using the app Icon in Honeycomb apps to go up to the home activity, however, when I run the activity on earlier, non Honeycomb devices where the Activity.getActionBar(); method does not exist yet, the app […]

Android – Change Actionbar Title Text Color

I’m developing an app and I want to change the textcolor of the actionbar title. now, I defined a theme in my manifest: <application android:theme=”@style/AppTheme”> </application> which is defined in styles.xml: <style name=”AppTheme” parent=”android:style/Theme.Holo.Light”> <item name=”android:textViewStyle”>@style/AppTheme.TextView</item> <item name=”android:actionBarStyle”>@style/AppTheme.ActionBarStyle</item> </style> <style name=”AppTheme.ActionBarStyle” parent=”@android:style/Widget.Holo.Light.ActionBar”> <item name=”android:titleTextStyle”>@style/AppTheme.ActionBar.TitleTextStyle</item> </style> <style name=”AppTheme.ActionBar.TitleTextStyle” parent=”@android:style/TextAppearance.Holo.Widget.ActionBar.Title”> <item name=”android:textColor”>@color/themeapp</item> </style> <style name=”AppTheme.TextView” parent=”@android:style/Widget.TextView”> <item […]

Center SearchView in Action Bar

How can I center an ActionView (a SearchView in particular) inside of a Action Bar? As seen in the Google Books app:   Google Books app SearchView http://i46.tinypic.com/2z909is.png My current layout setup (search_layout.xml): <?xml version=”1.0″ encoding=”utf-8″?> <SearchView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:queryHint=”@string/search_hint” /> My Action Bar XML file (menu.xml): <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:icon=”@+android:drawable/ic_menu_search” android:title=”@string/search” […]

How to always display ActionBar tabs below ActionBar in Android

I have been looking to see if there is any information on how to always display the ActionBar tabs below the ActionBar even when the phone is orientated to landscape. I know that automatically it places the tabs in the ActionBar depending on whether there is enough room on the screen to fit them, but […]

The best way to create drop down menu in android 2.x like in ICS

I want to create button with drop down menu, like overflow menu button in ActionBar on ICS. I have problem because PopupMenu there isn’t in android 2.x. The second way using Spinner but it’s not for me, because Spinner always show the first item on my custom background or my selected item. How can I […]

ActionBar MenuItem Divider

Is there a way to show Divider between the Menu Items in ActionBar for HoneyComb+. Some post says that the Divider will be shown only when the menu items has android:showAsAction=”withText”. I want to show only the Icon not the Text. I successfully shown Divider for Pre-HoneyComb by implementing a Action Bar Compatibility. I dont […]

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