Tag: android-actionbar

Search view close icon appearing disabled rather than white

Whenever I type into my search view the close button (X) appears to be disabled for some reason rather than appearing in the colour white. How can this error be resolved so that it appears white? @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu_search_list, menu); MenuItem item = menu.findItem(R.id.action_search); SearchView searchView = (SearchView) MenuItemCompat.getActionView(item); […]

Android 4.2.2 makes actionbar icon and title clickable as if part of the same button

Before 4.2.2, only the logo was clickable. As of 4.2.2, the title of the actionbar is clickable along with the logo – both as if part of the same button. You can see an example of this behavior in the Google Reader app – if you have a 4.2.2 device (See screenshot attached). How do […]

app:showAsAction vs android:showAsAction

I am building an Android app and want to have a button always visible on the actionBar. I followed this guide and others, but none of them seem to solve my problem (although they are very close I guess…). I have the package “app” and use app:showAsAction=”always”. No error is shown, but no button on […]

how to start contextual action bar for text view programatically with default opions copy and select all?

Is there any way to programatically start contextual action bar associated with a text view, on a button click? It should contain default options of copy/select all as well. Basically, I want to show the selection handles in my text view and the android default copy/select all option in action bar, on a button click […]

Align an icon with the Toolbar icon – Android Material Design

In the new Material Design (using AppCompat), I am trying to align some action icons with the drawer icon of the new toolbar. Something like: I think I am looking in all the metrics correctly… Touch Target Size The problem is that I can’t perfectly align it, because after that left padding of 16px, the […]

Android ActionBar setCheckable() not working

I’m trying to make one of the MenuItems on my Menu have a checkmark ability, but it doesn’t seem to work. All other MenuItems are working, this one does too, except for the checkmark display. What am I doing wrong? MenuItem actionPickMode = menu.add(0, 3, 0, “pickmode”); actionPickMode.setTitle(“Pick Mode”); actionPickMode.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT | MenuItem.SHOW_AS_ACTION_ALWAYS); actionPickMode.setVisible(true); actionPickMode.setCheckable(true);

ActionBar in PreferenceFragment not recalculating height and font size

Using the latest AppCompat-v21 library, I used ActionBarActivity to create and populate the PreferenceFragment. However, the ActionBar does not seem to change height and the text size when the orientation or screen size is altered. Testing this on other activities as well, this behavior only seems to be happening in PreferenceActivity (opposed to this question […]

Android- hide actionbar during startup and then show it again?

My android app has tab navigation using an action bar. It works well, but it bothers me that during the first boot of the app, a small default action bar briefly shows up before being replaced by the real, tab-navigation action bar. My onCreate starts like this: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.getWindow().requestFeature(Window.FEATURE_ACTION_BAR); setContentView(R.layout.activity_main); […]

Android Actionbar change menus position

I’m trying to use android-support-v7-appcompat and my problem change menus position to right of actionbar As you can see on the attached picture I wanna change the position of menu in action bar with custom view which is inflate of a custom layout.. hope to understand what I’m say

ActionBar with navigation tabs changes height with screen orientation

My goal is to increase the ActionBar height for portrait mode. I currently set android:actionBarSize in my Themes.xml. <?xml version=”1.0″ encoding=”utf-8″?> <resources xmlns:android=”http://schemas.android.com/apk/res/android”> <style name=”DayTheme” parent=”android:style/Theme.Holo.Light”> <item name=”android:actionBarSize”>@dimen/actionBarHeight</item> <item name=”android:actionBarTabTextStyle”>@style/tab_indicator_text_dark</item> </style> <style name=”NightTheme” parent=”android:style/Theme.Holo”> <item name=”android:actionBarSize”>@dimen/actionBarHeight</item> <item name=”android:actionBarTabTextStyle”>@style/tab_indicator_text_light</item> </style> </resources> I get the desired effect in landscape mode where I have increased the ActionBar height […]

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