ActionBarSherlock
ActionBarSherlock copied to clipboard
onQueryTextSubmit call twice
I try to use seacrhview supported by ActionBarSherlock, but encount problem unexpected。 After i set OnQueryTextListener ,it call OnQueryTextListener twice in ZTE930 and samsung note2 but work fine in my moto! I also try the fix :
- if (event.getAction() == KeyEvent.ACTION_UP) {
-
onSubmitQuery();
-
return true;
-
}
-
but it never call onQueryTextSubmit again! I don't kown why! Is there anyone help me? Thanks!return false;
Doesn't the platform SearchView
also have this behavior?
you can clear the query text in the editbox of SearchView after executing submit method for the first time by adding "sv.setIconified()"after your onSubmitQuery(),so that codes of submit method won't run as ACTION_UP triggers onQueryTextSubmit() because you have just empty querytext.
I also faced this problem with SearchView on HTC desire running Android 2.2. The search intent is called twice. Works Alright on Nexus 4 running 4.3.
I also faced this problem with SearchView on Emulator while input Enter with my hard keyboard.
Thanks #futureer...its worked