gpt4 book ai didi

java - Android Studio : Countdown timer which is also running when the app is closed

转载 作者:行者123 更新时间:2023-12-01 09:56:18 25 4
gpt4 key购买 nike

我想制作一个可以升级角色的应用程序。当您这样做时,您必须等待,例如 5 天。我的问题是如何修改计时器在应用程序关闭时也在运行的倒计时器?

最佳答案

正如 Bob 提到的,您可以使用 AlarmManager 来运行服务和检查。另一种方法是将上次更新日期保存在共享首选项中,并在用户尝试再次升级时检查时差。

关于java - Android Studio : Countdown timer which is also running when the app is closed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37188172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com