Showing posts from 2015

Example for using SearchView in ActionBar

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. &ltmenu xmlns:android="" xmlns:app="" xmlns:tools="" tools:context=".UploadActivity"&gt &ltitem android:id="@+id/search" android:icon="@android:drawable/ic_menu_search" app:actionViewClass="" android:title="@string/action_search" app:showAsAction=&…