Error : should use android:showAsAction when not using support library
我有一个ListActivity,然后一个menu/options.xml
android:showAsAction报错:
should use android:showAsAction when not using support library
1 <?xml version="1.0" encoding="utf-8"?> 2 <menu xmlns:android="http://schemas.android.com/apk/res/android"> 3 <item android:id="@+id/add" 4 android:title="Add" 5 android:icon="@drawable/ic_menu_add" 6 android:actionLayout="@layout/add" 7 android:showAsAction="ifRoom"/> 8 <item android:id="@+id/reset" 9 android:title="Reset" 10 android:icon="@drawable/ic_menu_refresh" 11 android:showAsAction="ifRoom|withText"/> 12 <item android:id="@+id/about" 13 android:title="About" 14 android:icon="@drawable/ic_menu_info_details" /> 15 </menu>
参考了这个:http://www.cnblogs.com/liaojie970/p/5718901.html
ListActivity继承自Activity,不应该啊
又参考这个:
http://stackoverflow.com/questions/27443363/error-should-use-androidshowasaction-when-not-using-support-library
解决办法:
AndroidStudio->Open Module Settings->Dependencies->删除AppCompat相关的东西