改变活动
如果我有 5 个(或更多按钮),当所有按钮都被按下时,是否可以更改活动。就像按下最后一个按钮时一样,我的应用程序应该更改活动。最后按下这五个按钮中的哪一个按钮并不重要。
有什么想法吗? :)
Is it possible if I have 5 (or more buttons) to change activity when all of then are pressed. Like when last button is pressed my app should change activity. And it shouldn't matter what button of those five is pressed last.
Any ideas? :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,为每个按钮创建一个布尔值数组:
在每个侦听器中,按下按钮时将数组中相应的单元格设置为 true,然后调用这样的方法(抽象实现):
Sure, create an array of booleans for each button:
In each of the listeners, when the button is pressed set the appropriate cell in the array to true, and then call such a method (abstract implementation):