Error: resource identifier found for attribute "showAsAction" in android package

I was working on an Android project and found an error that I can’t solve for quite some time. Here is the error that says

error:no resource identifier found for attribute"showAsAction" 

in the package android

and the error is in the following file login_.xml

<item
    android:id="@+id/action_settings"
    android:orderInCategory="100"
    android:showAsAction="never"
    android:title="@string/action_settings"/>

+5
source share
3 answers

This attribute is entered at API level 11. Check the minimum and target version of your application in the manifest file.

+5
source

The ShowAsAction attribute is entered in api 11. Change the minSdkVersion of your application in the manifest file.

If you want to use it for api below 11, you need to use the android support library "android.support.v4.app".

login.xml. , " : showAsAtion" " yourapp: showAsAction" "yourapp" .

<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:yourapp="http://schemas.android.com/apk/res-auto" >
<item
    android:id="@+id/action_settings"
    android:orderInCategory="100"
    yourapp:showAsAction="never"
    android:title="@string/action_settings"/>
</menu>
+5

android: showAsAction xml

-2

All Articles