设置OnClickListener,然后再打开 [英] Set OnClickListener off and then on

查看:127
本文介绍了设置OnClickListener,然后再打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置OnClickListener关闭用户点击按钮之后。

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

confirm.setOnClickListener(null);

这使得按钮不可点击,但我想用户点击另一个按钮后,它可以点击。

This makes the button unclickable but I want it to be clickable after the user has clicked another button.

我怎样才能做到这一点?

How can I do this?

感谢。

推荐答案

汤米,

你不能只是设置

confirm.setClickable(假); 禁用和 confirm.setClickable(真)再次启用它?

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

看到这里

这篇关于设置OnClickListener,然后再打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆