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" />
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>
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