问题描述
限时送ChatGPT账号..根据文档-
注意:默认情况下,这些限制仅适用于面向Android 8.0(API 级别 26)或更高版本.但是,用户可以启用大多数设置屏幕中任何应用程序的这些限制,即使该应用的目标 API 级别低于 26.
Note: By default, these restrictions only apply to apps that target Android 8.0 (API level 26) or higher. However, users can enable most of these restrictions for any app from the Settings screen, even if the app targets an API level lower than 26.
我的目标是低于 API 26,但我在官方 android 模拟器中找不到启用限制的设置.
I'm targeting Below API 26 but i cannot find the settings to enable the restriction in official android emulator.
此设置在何处可用?
推荐答案
启用后台限制的设置在应用信息中可用-> 电池屏幕.
尚无法在模拟器中重现.
当您最初安装应用程序(面向 API 26 以下)时,该选项不可用,直到应用程序完成一些后台工作.
The option is not available when you initially install the application (targeting below API 26) until the app does some background work.
所以我能够通过-
以 API 25 为目标应用创建长时间运行的服务(大约 5 分钟)从 MainActivity 的 onCreate 启动服务将应用程序发送到后台(按回)并让设备保持电池供电(未连接电源)几分钟后,该选项将可用以启用限制.
Within a few minutes, the option will be available to enable the restrictions.
这篇关于Android O 设置为应用程序启用后台限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论