I\'m currently using ActionBarSherlock 4.2 and it\'s SearchView widget in my app.
I wanted to make it submit query even though it\'s empty. I tried to set imeOptions and
I had the same problem, the problem lies onSubmitQuery() in SearchView.java
private void onSubmitQuery() {
CharSequence query = mQueryTextView.getText();
if (query != null && TextUtils.getTrimmedLength(query) > 0) {
Empty query's are not supported so I had to download and use ActionBarSherlock and then modify this method.
This is how my onSubmitQuery() looks like now
private void onSubmitQuery() {
CharSequence query = mQueryTextView.getText();
if (query == null) {query = "";}
if (mOnQueryChangeListener == null
|| !mOnQueryChangeListener.onQueryTextSubmit(query.toString())) {
if (mSearchable != null) {
launchQuerySearch(KeyEvent.KEYCODE_UNKNOWN, null, query.toString());
setImeVisibility(false);
}
dismissSuggestions();
}
}
Hope this helps.