开发者

Set OnClickListener off and then on

开发者 https://www.devze.com 2023-02-15 10:15 出处:网络
I am setting the OnClickListener off after the user has clicked on the button. confirm.setOnClickListener(null);

I am setting the OnClickListener off after the user has clicked on the button.

confirm.setOnClickListener(null);

This makes the button unclickable but I w开发者_如何学Pythonant it to be clickable after the user has clicked another button.

How can I do this?


Just set

confirm.setClickable(false); to disable and confirm.setClickable(true) to enable it again.

See Here


Simply

confirm.setOnClickListener(myOnClickListener);

Where myOnClickListener is your OnClickListener that you used before! This line of code would need to go in the OnClickListener for the 're-activation' button.

0

精彩评论

暂无评论...
验证码 换一张
取 消