gpt4 book ai didi

android - 有人知道 MIUI 11 中的 "start in background"权限在哪里吗?

转载 作者:行者123 更新时间:2023-12-03 13:28:16 25 4
gpt4 key购买 nike

我无法在 MIUI 11 redmi note 6 pro mobile 中开始 Activity ,我收到以下错误:

com.android.server.am.ExtraActivityManagerService: MIUILOG- Permission Denied Activity



我找到了一些解决方案,例如打开“在后台启动”权限。我在 MIUI 11 中找不到类似的东西。从字面上看,我不知道这个问题。提前致谢。

最佳答案

当应用程序停止时,我在从 BroadcastReceiver 启动 Activity 时遇到类似的问题。
1) 您可以在设置中找到您的应用并允许“在后台启动”权限。
2) 如果您需要以编程方式允许权限,请尝试打开应用程序设置

小米

此代码将打开 应用程序权限设置 ,您应该在其中允许“在后台启动”

Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR");
intent.setClassName("com.miui.securitycenter",
"com.miui.permcenter.permissions.PermissionsEditorActivity");
intent.putExtra("extra_pkgname", getPackageName());
startActivity(intent);

没有系统包装的设备

此代码将打开 应用程序设置 ,您应该在其中打开权限并允许“在后台启动”权限
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

阅读有关 android 设置 Intent 的更多信息:
How to open application permission window in app settings programmatically

您还可以 检查来自 github 的代码,以使用不同系统包装器(如 flyme、miui、oppo 等)中的权限:
https://github.com/zhaozepeng/FloatWindowPermission

希望这对你有帮助!

如果您有解决此问题的其他选择,我将不胜感激评论中的回复。 . .

关于android - 有人知道 MIUI 11 中的 "start in background"权限在哪里吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59214359/

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