如何计算在Android的按钮点击次数 [英] How to count number of Button clicks in Android

查看:526
本文介绍了如何计算在Android的按钮点击次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个Android应用程序,我需要算一个按钮被点击了多少次在特定时间内显示它的另一页,任何帮助?

i'm building an android application and I need to count how many times a button is clicked within a specific time the display it in another page, any help?

推荐答案

由@sandipon给出的答案是fine.But全局变量可以被破坏,您可以在情况下使用共享preferences存储价值,你会喜欢让它持久的。

The answer given by @sandipon is fine.But global variables could be destroyed,you can use SharedPreferences to store the value in case you'd like to make it persistent.

这篇关于如何计算在Android的按钮点击次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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