I've been working on an Android project and encountered an error which I'm unable to solve for quite a while. Here is the error which says
error:no resource identifier found for attribute"showAsAction"
in package android
and the error is in following file login_.xml
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
This attribute is introduced in API level 11. Check the min and target version of your app in Manifest file.
"ShowAsAction" attribute is introduced in api 11. Change the minSdkVersion of your app in Manifest file.
If you want to use it for api lower than 11, then you have to use android support library "android.support.v4.app".
After importing support library, you have to make some changes in your login.xml file. for e.g replace "android:showAsAtion attribute" by "yourapp:showAsAction" and define "yourapp" in header in this way.
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With