Tag: android-actionbar

Hint in Search Widget within Action Bar is not showing up

I have a Search Widget within an Action Bar. I have set up an android:hint value however It is not showing up when I click on the Search Icon. Relevant Files : MainActivity.java package com.example.myApp; import android.os.Bundle; import android.app.ActionBar; import android.app.Activity; import android.app.SearchManager; import android.content.Context; import android.view.Menu; import android.widget.SearchView; public class MainActivity extends Activity { […]

How to manage the width of ActionBar navigation tabs?

I am using ActionBarSherlock and have an ActionBar with navigation tabs in it. I want the tabs to auto-size based on the size of the text in them, but there seems to be a style or a setting somewhere that is forcing them to use a minimum size. So for example in the screenshot the […]

Using ActionBar Up Navigation in master/detail fragments

I have an app with master/detail layout (1 activity, 1 ListView fragment and 1 detail fragment). When the user clicks an item in the ListView, a fragment transaction instantiates a detail fragment on the right-pane that includes the information corresponding to that item. When the detail fragment is shown I hide the initial action bar […]

Drop Down Menu on Action bar

I am working on an android application Menu with Action Bar, I want to put the dropdown menu in the action bar like the one present in Google Maps application. Can somebody help me? How to achieve this Please point to some easy tutorial that I can follow.

ActivityUnitTestCase and startActivity with ActionBarActivity

I try to test a Activity which uses ActionBarActivity (from the appcompat library). I need a custom Application to be able to manipulate the DI system to load my test service instead of the real service. If I have my test written and call startActivity I get the following error: java.lang.IllegalStateException: You need to use […]

Set android:showAsAction=“ifRoom|withText” programmatically

Is it possible to set the flags as suggested here android:showAsAction=”ifRoom|withText” programmatically?

User defined ActionBar Action View: getting the width right

On Ice Cream Sandwich: I’m looking to add an AutoCompleteTextView to an ActionBar through the standard Action View mechanism (because SearchView isn’t available pre-ICS and I’m also using ActionBarSherlock): <item android:id=”@+id/menu_search” android:actionViewClass=”com.example.AutoCompleteActionView” android:showAsAction=”ifRoom” android:title=”@string/address”></item> <item android:id=”@+id/menu_close” android:icon=”@drawable/ic_menu_close_clear_cancel” android:showAsAction=”always”></item> <item android:id=”@+id/menu_ok” android:icon=”@drawable/ic_menu_ok” android:showAsAction=”always”></item> This works, however by default it does not consume the available space in […]

Is it possible to Implement Toggle Button in Action Menu Item using Actionbar sherlock in android

I have an app, which have toggle button in action menu item, though i’m using Actionbar Sherlock, I don’t know, how to place the toggle button in the action menu item. I don’t want to place as a custom layout in action bar, but i want to place it as a Menu item. If anyone […]

Start ICS emulator without Menu button

I’m trying to see the overflow menu in the ActionBar on ICS and I don’t have a device. I’m using the emulator and want to know, how do I start the emulator without a Menu button? I want to emulate a device with no Menu hardware button. I’ve looked on: http://developer.android.com/guide/developing/tools/emulator.html but I don’t see […]

How do I change the color of actionbar's up arrow?

How do I change the actionbar’s up arrow. I am using the action bar in android not ABS or actionbarcompat. Is there a way to change the color /image of the action bar’s up arrow ?

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