当我试图使用Android'我'命令来启动一个活动,它是在4.2的平台(我试过了,在2.3版本的确定).The code是这样的错
When I'm trying to use android 'am' command to start an activity ,it's wrong under 4.2 platform(I tried , it's ok under 2.3 version).The code is like this
out = process.getOutputStream();
out.write(("am start -a android.intent.action.VIEW -n com.android.browser/com.android.browser.BrowserActivity\n").getBytes());
out.flush();
InputStream in = process.getInputStream();
BufferedReader re = new BufferedReader(new InputStreamReader(in));
String line = null;
while((line = re.readLine()) != null) {
Log.d("conio","[result]"+line);
}
和错误是这样的:
java.lang.SecurityException: Permission Denial: startActivity asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:1921)
at com.android.commands.am.Am.runStart(Am.java:494)
at com.android.commands.am.Am.run(Am.java:109)
at com.android.commands.am.Am.main(Am.java:82)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
at dalvik.system.NativeStart.main(Native Method)
我想知道
1.什么呢用户-2和0的手段?
1.what does the user -2 and 0 means?
2.where我可以找到有关这些ID的详细信息?
2.where I can find the details about these ids?
3.什么,应该怎么办,只是添加的权限?我不想增加我对此事一无所知them.Could谁能帮我这的权限,非常感谢!
3.what should I do,just add the permissions? I don't want to add the permissions which I know nothing about them.Could anyone help me it,very thanks!
1)在linux下每个用户都有一个ID号。 0和2的用户ID(UID)的。 0是根,-2是一些随机的用户(这可能不是一个人,它可能只是用于内部原因一个假帐户)。
1)In linux every user has an id number. 0 and -2 are User IDs (UIDs). 0 is root, -2 is some random user (which may not be a person, it may just be a fake account used for internal reasons).
2)任何书上的Linux。 Android是基于Linux的只是一个图形化的框架。
2)Any book on Linux. Android is just a graphical framework on top of Linux.
3)是的,只是添加的权限。
3)Yes, just add the permission.
上一篇:JTransforms FFT Android中的PCM数据数据、FFT、JTransforms、PCM
下一篇:如何通过code来改变的Android SlidingDrawer的方向?Andr、code、SlidingDrawer、oid