i don't know why adding an <item>
to an Android action bar adds it to the menu instead.
this is the content of the menu xml file:
<item
android:id="@+id/showMenu"
android:title="test"
android:icon="@drawable/ic_launcher"
android:showAsAction="always"
/>
The showAsAction
line is undefined in red with a message : "should use app:showAsAction
with the AppCompat library..."
The Android documentation says 'If your app is using the Support Library for compatibility on versions as low as Android 2.1, the showAsAction attribute is not available from the android: namespace ... '
and to use yourApp:showAsAction
to support versions 2.1 to 3.0
But the minimum I support is 4.2 (SDK 18)
So why am I getting this message and how to solve this ?