Tag: android-actionbar

Change text dynamically for Android Actionbar Button

I have an Action Bar (using actionbarsherlock) that has two items in it. One of them is the amount of points the user has collected in my app. I want to change this Action Bar Button when the amount of points changes. I can’t figure out how to set the TextView of that Button. What […]

Hiding the title of an actionbar doesn't work on older versions of Android (using ActionBarSherlock)

I am trying to hide the title part of my actionbar using ActionBarSherlock like in the second picture: Setting: actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(false); works for versions >3.0 but doesn’t work on older versions. A black space remains over the tab bar. Is there a workaround to solve that issue?

ActionBar Tabs with fragments on rotate

I’am build an app with an ActionBar and two Tabs below. Everything works fine if the device / emulator isnt rotated. If rotated, tab state switches automaticale to tab1 (normal, because onCreate get called) but the content dont get changed. If I select a tab in the new orientation, the onCreateView() method from the selected […]

ActionBarCompat – App icon action (click) not working on 4.0 devices

I have this problem with the Android ActionBarCompat project: On emulators with Android 4.0 the click on the app icon doesn’t cause any onOptionsItemSelected event, whereas it works on all other OS versions. Any input is greatly appreciated!

How to set bold title in Action Bar?

I am editing the style xml trying to get the Activity title bold. <style name=”MyTheme” parent=”@android:style/Theme.Holo.Light”> <item name=”android:actionBarStyle”>@style/MyActionBar</item> </style> <style name=”MyActionBar” parent=”@android:style/Widget.Holo.Light.ActionBar”> <item name=”android:background”>#81CFEB</item> <item name=”android:textStyle”>bold</item> </style> But only what I can set is the background color desired. I do not why the textStyle is not set to bold. Anyone know how to solve it?

How to show menu popup exact below actionbar?

I am working on popup-menu in actionbar. But I am stuck to display exact below of actionbar(cut-to-cut).I am putting two snapshot. My issue screen shot: I want exact popup menu below of actionbar as below screenshot Correction screenshot: My code snippet: <menu xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” tools:context=”.MainActivity”> <item android:id=”@+id/action_filter” android:icon=”@drawable/ic_filter_white_18dp” android:title=”@string/action_filter” app:showAsAction=”ifRoom” /> <item android:id=”@+id/action_label” android:icon=”@drawable/ic_add_circle_outline_white_18dp” […]

Change Android 5.0 Actionbar color

I’m working with the new Lollipop Material Design guidelines and would like to incorporate that nifty navigation drawer animation in my app. I’ve gotten that far, by using the android.support.v7.app.ActionBarDrawerToggle, but now I’m having difficulty changing the color of said action bar. It stays bright gray no matter what I set the theme to. How […]

How do Android's new Toolbar and the Contextual Action Bar work together?

This question already has an answer here: Toolbar and Contextual ActionBar with AppCompat-v7 7 answers

MenuItem's checked state is not shown correctly by its icon

I have MenuItem defined this way: <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@+id/menu_starred” android:icon=”@drawable/btn_star” android:title=”@string/description_star” android:checkable=”true” android:checked=”true” android:orderInCategory=”1″ android:showAsAction=”always” /> </menu> and btn_star.xml defined this way: <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_checked=”false” android:drawable=”@drawable/btn_star_off_normal” /> <item android:state_checked=”true” android:drawable=”@drawable/btn_star_on_normal” /> </selector> When I create an options menu using this, however, the icon is never shown in its checked state, […]

Android AppCompat-v21 Toolbar Animation

I want to use new Android Toolbar pattern instead of ActionBar. I add a Toolbar as SupportActionBar from appCompat v21 and now, I want to hide/show it with animation while scrolling listView items. before, I use methods: actionBar.show() and actionBar.hide() and it animate automatically. but now, in Toolbar it hide and show without any animation. […]

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