android - setOnclickListner is initialized twice? -
passcode1 = (edittext) findviewbyid(r.id.passcode1); passcode1.setonkeylistener(new onkeylistener() { @override public boolean onkey(view v, int keycode, keyevent event) { if(keycode == keyevent.keycode_del){ passcode1.requestfocus(); } return false; } });
i have above code in oncreate method have kept break points , try debug see setonkeylistner called or initialized twice.
passcode1.setonkeylistener(new onkeylistener() { @override public boolean onkey(view v, int keycode, keyevent event) { if(keycode == keyevent.keycode_del && event.getaction() == keyevent.action_up){ //passcode1.settext(null); passcode1.requestfocus(); return true; } return false; } });
adding key event solved issue
what understood is initialized twice because has create box key down , key action
thats y added key down check, still initialized twice used once
Comments
Post a Comment