且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关闭应用程序后,Android的警报被取消

更新时间:2023-01-12 09:13:14

这是正常的行为。如果用户自行强制停止应用程序了,那么就应该停止。否则,要创建像应用程序中的病毒。

This is normal behaviour. If the user voluntarily force stop the applicaiton, then it should be stopped. Else, you are creating a virus like application.

如果你真正想要的,你可以写它监视,如果您的其他服务正在运行,如果一个服务没有运行运行服务的其他服务。但是,这将是另一个应用程序,(你希望)使用任务管理器的用户不会杀了这个程序。

If you really want, you could write another service which monitors if your other service is running and runs the service if the one is not running. But this will be another application and (you hope) the user wont kill this app using task manager.

就个人而言,我不会担心。如果用户停止了,他们想阻止它。不要骚扰用户。

Personally, I wouldn't worry. If the user stopped it, they wanted to stop it. Don't annoy the user.