Again a support library problem, recently by this android.support.v4 and android.support.v7 tortured desperate, a lot of things because version changes have a lot of different. Since my project with fragment V4 Surpport package, so in the activity inheritance actionbaractivity inherited V7, do not know why the Action Bar item on the icon is not displayed. Check the cause.
The answer on the StackOverflow.
This was because if you use the support AppCompat ActionBar Library and actionbaractivity you should create your menus in a Different than the standard-of-the-creating XML menus in Actiobarsherlock or the default ActionBar.
<menu xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/ Apk/res-auto "> <item android:id=" @+id/action_search " android:icon=" @drawable/ic_action_search " android:title= "@string/action_search" app:showasaction= "always" /> <item android:id= "@+ Id/action_compose " android:icon=" @drawable/ic_action_compose " android:title=" @string/action_compose " app:showasaction= "Always"/></menu>
Added a second line:
xmlns:app= "Http://schemas.android.com/apk/res-auto"
and change the downward android:showasaction= "always" to
Check the official documents also did not very clear, in short, is solved.
Android is really a pain in solving version compatibility issues ... How to say, recently summed up the experience is to be sure to Google, preferably in English, Baidu an afternoon than Google a few minutes to solve the problem =
Problem with icon not appearing on Android Actionbar