ActionBarSherlock icon indicating copy to clipboard operation
ActionBarSherlock copied to clipboard

onQueryTextSubmit call twice

Open ohmerhe opened this issue 11 years ago • 5 comments

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;
    
  •       }
    
  •       return false;
    
    but it never call onQueryTextSubmit again! I don't kown why! Is there anyone help me? Thanks!

ohmerhe avatar Apr 25 '13 08:04 ohmerhe

Doesn't the platform SearchView also have this behavior?

JakeWharton avatar Jul 02 '13 20:07 JakeWharton

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.

futureer avatar Jul 27 '13 09:07 futureer

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.

droidster avatar Aug 06 '13 19:08 droidster

I also faced this problem with SearchView on Emulator while input Enter with my hard keyboard.

MoseDien avatar Apr 19 '16 04:04 MoseDien

Thanks #futureer...its worked

vineetjain495 avatar Jun 15 '16 07:06 vineetjain495