Tag: android-actionbar

What is the difference between setDisplayHomeAsUpEnabled and setHomeButtonEnabled?

I want to enable the home button in the Action bar. I’m using this code: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { actionbar.setHomeButtonEnabled(true); actionbar.setDisplayHomeAsUpEnabled(true); } In this I’m using setHomeButtonEnabled and setDisplayHomeAsUpEnabled to put a back mark at icon in ActionBar. If I use only setDisplayHomeAsUpEnabled then also will it work? Is there a need to set […]

How do I show Overflow Menu Items to Action Bar in Android

I am writing an Android App in which i am trying to show Overflow Menu Items to ActionBar using this great tutorial link: http://wptrafficanalyzer.in/blog/adding-action-items-and-overflow-menu-items-to-action-bar-in-android/ Problem: Not getting Overflow Menu Items (Icon) Please see below Screen Shot for more clarity: Manifest.xml: <uses-sdk android:minSdkVersion=”14″ /> <application android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” > <activity android:name=”.MainActivity” android:label=”@string/app_name” android:uiOptions=”splitActionBarWhenNarrow” > items.xml: <?xml version=”1.0″ […]

Changing action bar searchview hint text color

How can I change the action bar search view hint text colour? This question explains how to get the EditText when using ABS: Android ActionBar Customize Search View Is there a android.R.id I could use to get a reference to the EditText so I could change the hint colour? Or is there some other way […]

Action Bar not showing action view icons

I’m using the new Action Bar Support and all my action views are shown in overflow and not as icons in the bar. My app is for 7+ API. HomeActivity: public class HomeActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(R.string.app_name); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); } @Override public boolean onCreateOptionsMenu(Menu menu) […]

Full-width Spinner in ActionBar

I’d really like my app to have a Spinner which stretches the entire length of my ActionBar, like the one in Gmail 4.0. Anyone know how to achieve this? Even if I set “match_parent” in the Spinner layout resource, it doesn’t fill the entire bar. Preferably, I’d like to be able to have it fill […]

Android Activity without ActionBar

I have different activities in my App and in all of them I do not want the Action Bar. I cannot find how to disable it. I have tried to find an attribute to apply it to the main_activity.xml but so far I did not find anything. Can somebody help me please?

popupBackground glitches with Material Design

I have been working on updating my apps to Material Design. I have an app that uses tabs. For some reason whenever I use android:popupBackground to set the drop down menu color it freaks out. I set up a default project with tabs and used the following theme and the same thing happened. Has anyone […]

Android SearchView Icon

I want to disable the Mag icon displayed inside the search view component. Any idea how to reference it and remove it or replace it with another drawable ?

Search View uses app icon instead of logo

Android documents explain that app logo is used everywhere when it is defined. But when the search view expands, app icon is used instead of app logo and I can’t find a way to show app logo when search view is in expanded state. Here are the relevant parts. Manifest file <application android:name=”MyApp” android:allowBackup=”true” android:icon=”@drawable/app_icon” […]

Show progress spinner (refresh) on ActionBar?

I’m using the ActionBar. I’d like to have a refresh progress spinner on the titlebar, if I set it to spinning – otherwise hide it. Is that possible?: // My menu has a refresh item, but it shouldn’t be visible on the // actionbar unless it’s spinning. <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@+id/menu_refresh” android:title=”@string/refresh” android:icon=”@drawable/ic_action_refresh” /> </menu> […]

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