android - How to disable button as soon as its clicked -
i have button on click loads activity, before loads activity if tap continuously, launches activity same activity loaded 2 times or more. have tried button.setenabled(false) after button.setonclicklistener...onclick not disabling button, logging text button tapped, depending on taps logs text 2 or 3 times if had tapped 10 times. feel here before button can listen tap events, tapping fast listens events many times tap it.
thus need button can listen 1 tap , disable it.
please help
its known issue.basically u can set flag.
int flag=1; @override public void onclick(view v) { if(flag) { button.setenabled(false); log.d("ins", "called"); } flag=0; }
Comments
Post a Comment