Tag: android-actionbar

Android How to edit the Action bar menu from Fragment

I created an App that uses Fragment. From my MainActivity I set the ActionBar. But in one of my Fragment I need to modify the action icons and on click. So With the code below, when I load the my Fragment, it still display the action bar menu from MainActivity here is my MainActivity : […]

invalidateOptionsMenu doesn't work in fragment

I want to show or hide item in actionbar according to either their is text in the edit text or not so I did the following public class NounSearch extends android.app.Fragment { EditText seachEditText; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); View rootView = inflater.inflate(R.layout.nounsearchactivity, container, false); //Intiate EditText seachEditText =(EditText) […]

Android – customizing actionbar sherlock tabs

Im trying to customize the actionbar sherlock tabs so they display the tab text below the tab icon. After searching and reading about the subject, I’m still not having much luck. Here are the results I’m getting: Custom tab1 selected Custom tab1 not selected, standard tab2 selected This is what I have so far: Created […]

Center Align title in action bar using styles in android.

Hi I am developing android application. In my application I am using action bar. I want to make center align my title of window in action-bar. I know it is possible using xml files. but I want to do it using style so that it will applicable for my every window, how to do this […]

How to change ActionMode background color in Android

i am creating an android app in which support level api is 7 so i am using sherlock actionbar. I am using action mode in it. Issue is i want to change the background of action mode. So i have tried <item name=”android:background”>@color/something</item> <item name=”android:backgroundStacked”>@color/something</item> <item name=”android:backgroundSplit”>@color/something</item> these style solution’s available but none of them […]

I'm having trouble getting the Android Search Interface to work in the Action Bar

I tried following the guide here, but I’m having some problems. I correctly got the search icon to appear in the action bar, but I’m having trouble attaching the searchable configuration to the SearchView. My res/menu/options_menu.xml file: <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@+id/search” android:title=”@string/search_title” android:icon=”@drawable/search” android:showAsAction=”collapseActionView|ifRoom” android:actionViewClass=”android.widget.SearchView” /> </menu> My res/xml/searchable.xml file (Note: I […]

Disable Action Bar button in Android

Is it possible to disable a button in Action Bar in Android? I was looking around and I could not find any code snippet for that, I was thinking that there should be some easy way.

Actionbar items are duplicating

I have Action Bar in my application. I am adding action items using menu.xml. I am using action bar-compat as my support library. I observed a weird issue where my action items are getting duplicated. I am finding this issue randomly when leave my device idle or work with other applications. Please find the screen […]

ActionBar Tabs – Fixed and Scrollable?

In the Android Design Guidelines it states that “There are two types of tabs: fixed and scrollable.” I can’t find any documentation in the ActionBar documentation to support the ability to specify either type of tabs. How do you specify a tab group to be fixed or scrollable? If you can’t, what governs whether the […]

Material Design Transparent ActionBar

I’d like to know if anyone knows how to make an activity with transparent action bar, like the one you have in the new Google Play Store when you go to an app’s page. I don’t care about the scrolling and turning from transparent into solid color background, I just need the action bar transparent. […]

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