仅在页面加载后启用按钮单击
我有一个页面仅包含一个列表视图。单击列表中的一行后,将加载下一页。下一页包含一组按钮。单击列表中的一行后,加载下一页可能需要一些时间。因此,如果有人连续单击该行,那么在某个时间点,就会出现第二页,并且单击其中的按钮,这是我不需要的。如何防止点击按钮?有人可以帮我吗。提前致谢。
I have a page which contains a listview alone. Upon clicking a row in the list, the next page is loaded. This next page contains a set of buttons. Upon clicking a row in the list, the loading of the next page may take sometime. So if someone is continuously clicking the row then at some point of time, the second page comes and the buttons inside that gets clicked, which I dont require. How can I prevent this clicking of buttons? Can someone help me out. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 AsyncTask 概念为下一个 Activity 加载数据,如下所示
Use AsyncTask concept to load data for next activity, do as follow:
除了您的 Activity 最初加载时间不应该那么长之外,您还可以在调用
startActivity()
来启动新 Activity 时设置一个布尔值。然后,如果用户在加载下一个活动之前单击其他任何内容,则检查该布尔值。Besides the fact that your activities shouldn't take that long to load initially, you could just set a boolean when
startActivity()
is called to start the new activity. Then check that boolean if the user clicks anything else before the next activity is loaded.使用时你需要 false click 事件和 true
我认为当你想像这样
::当你想启用时只需写
i think you need to false click event and true while you want to use
like this::
and when you want to enable just write