Using SearchView on Post-Android 3.0
Now you have a search interface that works everywhere. However, it does not work in a Honeycomb-approved fashion.
Honeycomb added a new class called SearchView. SearchView is an action view – a view that may be included within the action bar. SearchView allows your entire search interface to take place within your activity’s action bar, instead of inside a dialog superimposed on your activity. That means that it has the same styling and theming as your application, which is a good and fine thing.
Using an action view is as simple as adding an android:actionViewClass attribute to your menu item tag, like so:
Listing 28.14 Add an action view to your menu (res/menu/fragment_photo_gallery.xml)
<menu xmlns:android="http://schemas.android.com/apk/res/android"> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access