【发布时间】:2017-12-02 10:58:15
【问题描述】:
我正在开发一个应用程序,用户每天只能查看 10 个配置文件(12 小时)。所以我想创建一个全局变量,设置为每个周期的 10 开始。当用户签出 1 个配置文件时,它会减 1。当计数器为 0 时,我将显示一条达到限制的消息。并且这个计数器在 12 小时后被修改。
这应该是什么方法?
【问题讨论】:
-
见
SharedPreferences- 文档说:"The SharedPreferences class provides a general framework that allows you to save and retrieve persistent key-value pairs of primitive data types. You can use SharedPreferences to save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed)." -
使用共享偏好
-
谢谢,如何跟踪 12 小时周期?
-
@greenapps 你最好在 facebook 的其他地方使用那些有趣的台词
-
啊哈邮递员。一天之内。服务很好。
标签: java android timer counter