3

I use ActivityGroup for TAB UI, and one Tab content is Android Settings view, I used this method to embed into:

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();

And it works well in Android 2.3.3, but now I have to move to Android 4.0, Unfortunately it doesn't work with the exception like the below:

05-13 07:02:36.242: E/AndroidRuntime(1118): java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.Settings}: java.lang.SecurityException: Given caller package com.android.settings is not running in process ProcessRecord{414674b0 1118:com.gul.desktop/10040}

Can buddies tell me how to solve it, and what't the ProcessRecord?

4

2 回答 2

3

我将 ActivityGroup 用于 TAB UI

从 API 级别 11 开始正式弃用。

它在 Android 2.3.3 中运行良好

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

有大佬能告诉我怎么解决吗

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

于 2012-10-06T16:57:28.940 回答
0

您收到此异常是因为在您的清单文件中,您可能已注册您的活动两次或多次。

例如:

<activity android:name=".MainActivity" android:label="@string/app_name"> 
                         ^^^^^^^^^^^^
     <intent-filter> 
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
     </intent-filter>
 </activity>

<activity android:name=".MainActivity"> </activity>
                         ^^^^^^^^^^^^  

删除不需要的行..希望这对你有用..!

于 2012-05-13T08:51:27.333 回答