Fri Nov 30 16:01:55 PST 2018
Beginning in Android 3.0, using the SearchView widget as an item in the action bar is the preferred way to provide search in your app. Like with all items in the action bar, you can define the
SearchView to show at all times, only when there is room, or as a collapsible action, which displays the SearchView as an icon initially, then takes up the entire action bar as a search field when the user clicks the icon.
Create your menu.xml as following. <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=".UploadActivity"> <item android:id="@+id/search" android:icon="@android:drawable/ic_menu_search" app:actionViewClass="android.support.v7.widget.SearchView" android:title="@string/action_search" app:showAsAction=&?
Comments
Post a Comment