从最近删除应用程序时停止后台服务

编程入门 行业动态 更新时间:2024-10-24 03:25:03
本文介绍了从最近删除应用程序时停止后台服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

后台服务停止,当我在 oppo & 中从最近删除我的应用程序时vivo手机,&在这种情况下,广播接收器也不起作用.

Background service is stop, when removing my app from recent in oppo & vivo mobiles, & Broadcast reciever also not working in that case.

推荐答案

我在 Oppo、Vivo、Mi 等手机上遇到了同样的问题,

I had same issue with Oppo, Vivo, Mi and etc phones,

从最近的应用程序中删除后,应用程序被杀死,甚至服务也被杀死

解决方案:我在我的应用程序中添加了自动启动权限,例如 this 并且它起作用了.

Solution: I had add autostart permissions like this in my application and it worked.

解决此问题后,由于 DOZE 模式,我的应用程序在后台运行一段时间后被冻结/终止解决方案:对于这种情况这个有效,现在我的应用程序在任何设备的后台运行

After resolving this issue my app was getting frozen/killed after sometime running in background due to DOZE mode Solution: for this condition this worked and now my app is working in background in any device

完成以上操作后:

intent.setClassName("com.coloros.oppoguardelf", "com.coloros.powermanager.fuelgaue.PowerConsumptionActivity");开始活动(意图);

intent.setClassName("com.coloros.oppoguardelf", "com.coloros.powermanager.fuelgaue.PowerConsumptionActivity"); startActivity(intent);

调用上述意图,它会将您重定向到电池选项,禁用后台冻结,异常应用优化和打盹从\节能器->youAPP"

call above intent, it will redirect you to battery option, "Disable Background Freeze, Abnormal Apps Optimization and Doze from \"Energy Saver ->youAPP"

注意:调用上述意图后,您可能会获得不同的选项来关闭省电选项.

Note: Once you call above intent, there you may get different options to turn off Battery saving options.

这篇关于从最近删除应用程序时停止后台服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-23 03:42:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034370.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   后台

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!