Here is this widget for an ActionBar called "SearchView". When not in use, it looks like this:

And when it is used, it looks like this:

I want (programmatically, of course) to open a searchview (make it "in use").
I tried several functions, such as:
SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView(); searchView.setOnQueryTextListener(this); searchView.performClick(); searchView.requestFocus();
But none of those worked ...
SearchView in XML:
<item android:id="@+id/menu_search" android:title="Search" android:icon="@drawable/ic_action_search" android:showAsAction="ifRoom|collapseActionView" android:actionViewClass="android.widget.SearchView" />
java android android-actionbar
Eli Revah Jan 09 '13 at 12:54 on 2013-01-09 12:54
source share