java - Can't handle a SearchView on android -


i trying add , handle searchview in toolbar according second asnwer of topic how add search button on toolbar in material design

however, have such mistake:

error:(8) no resource identifier found attribute 'actionviewclass' in package 'com.example.user.mobinfouz' error:execution failed task ':app:processdebugresources'.

com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files (x86)\android\android-sdk\build-tools\21.1.2\aapt.exe'' finished non-zero exit value 1

here's code of menu_main xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".mainactivity">  <item android:id="@+id/action_search"     android:icon="@drawable/search_icon"     android:title="@string/search"     app:showasaction="ifroom"     app:actionviewclass="android.support.v7.widget.searchview"     android:orderincategory="1"     android:menucategory="secondary"/> 

try set attribute :

 app:actionviewclass="android.support.v7.widget.searchview" 

instead of

app:actionviewclass="android.support.v7.widget.searchview" 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -