EDIT For anyone who wondered, my problem was to use android.widget.SearchViewinstead android.support.v7.widget.SearchView. Hope this helps someone else with the same issue!
Original publication
I am trying to implement SearchView in an Android ActionBar according to the official guide: http://developer.android.com/training/search/setup.html
After failing to find the problem, I finally split into the most basic Hello World application and was surprised to find that the error still persists in the minimal application!
Here's the error: The search icon appears in the menu bar, no problem. When I click on it, the search bar expands (as expected), but the cursor does not appear and the soft keyboard does not appear. (I want to post a photo, but my reputation is too low :(
Here is the relevant code, although I literally just created a new Android application and added an item to the / menu _main.xml menu. MainActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
menu_main.xml
<item android:id="@+id/action_search"
android:icon="@android:drawable/ic_menu_search"
android:title="@android:string/search_go"
app:showAsAction="collapseActionView|ifRoom"
app:actionViewClass="android.widget.SearchView" />
source
share