Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search View not respond when click in AppCompat Toolbar

I write code like this, but it doesnt work.

I just inflate menu in java, nothing else.

I'm using toolbar(v7) instead of actionBar.

Any problem in here??

(No Clicked effect- too.)

<item android:id="@+id/action_search"
        android:title="Search"
android:icon="@drawable/abc_ic_search_api_mtrl_alpha"
        app:showAsAction="always|collapseActionView"
    app:theme="@style/MySearchViewStyle"
        app:actionViewClass="android.support.v7.widget.SearchView" />
like image 409
InHo KIM Avatar asked Oct 28 '14 14:10

InHo KIM


1 Answers

Try this. Because, This one Works for me ...

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/action_search"
        android:icon="@android:drawable/ic_menu_search"
        app:showAsAction="always"
        app:actionViewClass="android.support.v7.widget.SearchView"
        android:title="Search"/>
</menu>
like image 145
AruLNadhaN Avatar answered Oct 14 '22 02:10

AruLNadhaN