gpt4 book ai didi

java - 我想让我的 Android 应用程序在后台 24/7 运行,除非被用户关闭..我该怎么办..?

转载 作者:行者123 更新时间:2023-12-01 06:59:04 24 4
gpt4 key购买 nike

我希望我的应用程序在后台运行,因为它必须每秒获取时间..并在用户设置时间并希望应用程序当时执行某些任务时执行一些任务..!!

最佳答案

您是否考虑过使用 AlarmManager

Android provides an AlarmManager service that will let you specify an Intent to send at a designated time. This intent is typically used to start an application at a preset time. (Note: If you want to send a notification to a sleeping or running application, use Handler instead.)

关于java - 我想让我的 Android 应用程序在后台 24/7 运行,除非被用户关闭..我该怎么办..?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4288062/

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