petehallw petehallw - 19 days ago 6
Android Question

Failed to find style 'listMenuViewStyle' in Android Studio

I'm trying to add icons to my menu items in my android application. However the layout preview window in Android studio is displaying the error:

Failed to find style 'listMenuViewStyle' in current theme


I'm using the Holo.Light theme, and have tried a number of other themes with no luck. My layout xml is as follows:

<menu xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"
tools:context="com.me.myApp.activities.StartActivity" >

<item android:id="@+id/action_settings"
android:title="@string/menu_section_settings"
android:icon="@drawable/ic_settings"
android:showAsAction="never" />

<item android:id="@+id/action_about"
android:title="@string/menu_section_about"
android:icon="@drawable/ic_help"
android:showAsAction="never" />

</menu>


What am I missing here? Thanks!

Answer

The attribute listMenuViewStyle was introduced with api level 24. Make sure you use compileSdkVersion 24 or above.