Because Key has a down and up event, it executes two times.
Class Edittextonkeyclicklistener implements Etonkeyclicklistener {@Override public boolean onkeyclick (View V, int keycode, keyevent event) {//TODO auto-generated Method Stub if (keycode = = Keyevent.keycode _enter&& event.getaction () = = Keyevent.action_down) {Inputmethodmanager IMM = (Inputmethodmanager) V.getcontext (). Getsystemservice (Context.input_method_service); Key = Search_edit_text.gettext (). toString (); if (imm.isactive ()) {Imm.hidesoftinputfromwindow (), V.getapplicationwindowtoken (), 0); } load_view.setvisibility (view.visible); page = 0; Searchbookasynctask task = new Searchbookasynctask (key, Load_view, view, Mybooklist, Search_book_ad Apter, page, null, NULL, 0, list, SHOWLIST,BG); Task.execute (); } return false; } }
Android EditText Click Enter will respond two times to the solution