gpt4 book ai didi

android - BroadcastReceiver 在几个小时后停止在小米上工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:42:51 24 4
gpt4 key购买 nike

我正在使用 Awareness API对于我的项目并通过 BroadcastReceiver 接收操作。这是我的代码的问题:link .问题是除了Xiaomi 设备外,所有android 版本都运行良好。 BroadcastReceiver 在几个小时后没有收到任何东西。我为此尝试了很多解决方案(例如 thisthis 以及为我的应用关闭节电功能),但似乎没有任何效果。

最佳答案

Google Awareness :

And whilst doing so, the API collates data from multiple sources to ensure that the data provided is both accurate and of a high quality. It also takes into account both the power and memory consumption when accessing these signals - helping to ensure that the battery life and memory usage of our applications do not have a detrimental effect on the users device.

正如这一段所说:

It also takes into account both the power and memory consumption when accessing these signals

然后你说:

The problem is that everything works fine in all android version except in Xiaomi devices. Where BroadcastReciver not receiving anything after couple of hours

几个小时后设备可能会节省更多能源

您正在监听“Fence API”以注册用户当前环境的变化它可能会消耗电量,因此您不会收到广播您可能需要更改设备设置以允许使用传感器,例如位置 GPS 和其他相关传感器

关于android - BroadcastReceiver 在几个小时后停止在小米上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51279363/

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