Android O 设置为应用程序启用后台限制

编程入门 行业动态 更新时间:2024-10-26 20:32:35
本文介绍了Android O 设置为应用程序启用后台限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

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

发布评论

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

>www.elefans.com

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