android - ImageView not clickable while secondary thread is running -
i trying imageview not clickable while thread running. when thread finish bring imageview clickable again.
something this:
@override protected void oncreate(bundle savedinstancestate) { ... imageview.setclickeable(false); // or setenabled = false new thread(){ public void run(){ anotherclass.secondclassmethod(); } }.start(); imageview.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { ... } }); } private anotherclasscallback callback = new anotherclasscallback(){ @override public void hasfinished(){ imageview.setclickable(true); // or setenabled = true } }; but not working because, example, if click 3 times on imageview while thread running, when hasfinished method executes looks kept 3 clicks , runs 3 ontouch straightaway.
does know whats happening?
thx u!
ontouch , onclick not same, when setting onclickable false touch events still fired. maybe try doing doing in setonclicklistener()
Comments
Post a Comment