android - SecurityException : Given caller package com. android.settings 未在进程 ProcessRecord 中运行

标签 android settings activitygroup

我使用 ActivityGroup 作为 TAB UI,其中一个 Tab 内容是 Android Settings View , 我使用这种方法嵌入到:

final Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS);
settings.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Window subActivity = getLocalActivityManager().startActivity("SubActivity_Settings", settings);
vSettings = subActivity.getDecorView();

它在 Android 2.3.3 中运行良好,但现在我必须迁移到 Android 4.0, 不幸的是,它不适用于如下所示的异常:

05-13 07:02:36.242: E/AndroidRuntime(1118): java.lang.RuntimeException: 无法恢复 Activity {com.android.settings/com.android.settings.Settings}: java.lang.SecurityException :给定调用程序包 com.android.settings 未在进程 ProcessRecord{414674b0 1118:com.gul.desktop/10040}

中运行

哥们能告诉我怎么解决吗,ProcessRecord是什么?

最佳答案

I use ActivityGroup for TAB UI

自 API 级别 11 起已正式弃用。

And it works well in Android 2.3.3

不是真的。它看起来“运行良好”,但用户实际上无法更改您自己的 UI 无法更改的任何设置。 Android 4.0 只是进一步加强了安全性。

Can buddies tell me how to solve it

针对普通 SDK 应用程序可以修改的设置,编写您自己的 UI 来修改设置。或者,使用 android.provider.Settings 上的 Intent 操作,通过 startActivity() 启动设置应用。

关于android - SecurityException : Given caller package com. android.settings 未在进程 ProcessRecord 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10570050/

相关文章:

visual-studio-code - VSCode 设置 'insertFinalNewline' 不起作用

android - 暂停和恢复 ActivityGroup 中的子 Activity

android - 位图像素值在同一像素上的 setPixel() 和 getPixel() 之后不同

android - 如何保持 Button Background Drawable 的纵横比

google-chrome - 谷歌浏览器 : This setting is enforced by your administrator

android - 使用选项卡中的 ActivityGroup 切换 Activity (Android)

android - 无法从另一个模块 : Android studio 调用方法

android - 时间选择器最短时间

vim - 当一行不适合屏幕时,如何防止 Vim 显示 at 符号 (@)?