For the need of my application, I needed a custom View in the ActionBar (because this view should be modified easily by code)
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_custom"
android:actionLayout="@layout/menu_layout"
android:showAsAction="always"/>
</menu>
That’s not very difficult 😉
Now the problem is that my View does not react visually to the click anymore.
I know that I could use a custom background with pressed/selected/.. state, but I would like to use the default ACtionBar background, so I am sure I won’t break anything on some devices.
I have started looking at ActionBarSherlock and Android source code, but I don’t know exactly where to look.
Thank for any help.
These are the action item background selectors from ActionBarSherlock:
and the corresponding files in the SDK: