拒绝许可的意图外部活动 [英] Permission Denial for intent to external activity

查看:148
本文介绍了拒绝许可的意图外部活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的整个想法是有点复杂,但只是为了打破东西下来,他们简单,这里的点...我有一个小窗口,我需要在打开的地方活动按钮官方的Facebook应用程序。

这里的code我使用的:

 意图PlacesIntent =新的意图(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(新的组件名(com.facebook.katana,com.facebook.katana。 activity.places.PlacesNearbyActivity));
            PendingIntent pendingIntent = PendingIntent.getActivity(上下文,0,PlacesIntent,0);
            views.setOnClickPendingIntent(R.id.places,pendingIntent);
 

我得到了logcat的这个错误:

  11-06 22:26:48.117:WARN / ActivityManager(85):权限被拒绝:checkComponentPermission()reqUid = 10055
    11-06 22:26:48.117:WARN / ActivityManager(85):权限拒绝:在启动意向书{行为= android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] FLG = 0x10000000处CMP = com.facebook .katana / .activity.places.PlacesNearbyActivity bnds = [371129] [428203]}从空(PID = -1,UID = 10157),需要空
    11-06 22:26:48.127:WARN / ActivityManager(85):无法发送startActivity意图
    11-06 22:26:48.127:WARN / ActivityManager(85):java.lang.SecurityException异常:权限被拒绝:在启动意向书{行为= android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] FLG = 0x10000000处CMP = com.facebook.katana / .activity.places.PlacesNearbyActivity bnds = [371129] [428203]}从空(PID = -1,UID = 10157),需要空
    11-06 22:26:48.127:WARN / ActivityManager(85):在com.android.server.am.ActivityManagerService.startActivityLocked(ActivityManagerService.java:3223)
    11-06 22:26:48.127:WARN / ActivityManager(85):在com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:3980)
    11-06 22:26:48.127:WARN / ActivityManager(85):在com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:212)
    11-06 22:26:48.127:WARN / ActivityManager(85):在com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:3843)
    11-06 22:26:48.127:WARN / ActivityManager(85):在android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:210)
    11-06 22:26:48.127:WARN / ActivityManager(85):在com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1480)
    11-06 22:26:48.127:WARN / ActivityManager(85):在android.os.Binder.execTransact(Binder.java:288)
    11-06 22:26:48.127:WARN / ActivityManager(85):在dalvik.system.NativeStart.run(本机方法)
 

如果我使用,

 意图PlacesIntent1 =新的意图(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(新的组件名(com.facebook.katana,com.facebook.katana。 HomeActivity));
            PendingIntent pendingIntent1 = PendingIntent.getActivity(上下文,0,PlacesIntent1,0);
            views.setOnClickPendingIntent(R.id.facebook,pendingIntent1);
 

一切的伟大工程,它打开了家里的活动,但是这不是真的是我想要做的。

我试过

  com.facebook.katana.activity.places.PlacesNearbyActivity  - 我居然看到了respons在logcat中有关与此的一个denail
com.facebook.katana.activity.PlacesNearbyActivity
com.facebook.katana.places.PlacesNearbyActivity
com.facebook.katana.PlacesNearbyActivity
 

和与其他人没有任何反应

下面就是我在logcat中看到,当手动在我的手机打开活动:

  11-06 20:20:38.295:信息/ ActivityManager(85):启动活动:意向{CMP = com.facebook.katana / .activity.places.PlacesNearbyActivity}

11-06 22:03:28.027:信息/ ActivityManager(85):启动活动:意向{FLG = 0x4000000 CMP = com.facebook.katana / .HomeActivity}
 

所以,这给你那种想法我如何得到我的信息。

解决方案
  

我有一个小窗口,我需要在官方Facebook应用程序打开场所活动的按钮。

由于看来Facebook并没有用自己的Andr​​oid应用程序集成赞同这种方式,请不要这样做。

 权限被拒绝:checkComponentPermission()reqUid = 10055
 

这项活动只能通过Facebook的开始。

My whole idea is a little more complex, but just to break things down so they're simple and to the point here...I have a button on a widget that i need to open the "places" activity in the official facebook app.

Here's the code i'm using:

 Intent PlacesIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName("com.facebook.katana", "com.facebook.katana.activity.places.PlacesNearbyActivity"));
            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, PlacesIntent, 0);
            views.setOnClickPendingIntent(R.id.places, pendingIntent);

I get this error in the logcat:

 11-06 22:26:48.117: WARN/ActivityManager(85): Permission denied: checkComponentPermission() reqUid=10055
    11-06 22:26:48.117: WARN/ActivityManager(85): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.facebook.katana/.activity.places.PlacesNearbyActivity bnds=[371,129][428,203] } from null (pid=-1, uid=10157) requires null
    11-06 22:26:48.127: WARN/ActivityManager(85): Unable to send startActivity intent
    11-06 22:26:48.127: WARN/ActivityManager(85): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.facebook.katana/.activity.places.PlacesNearbyActivity bnds=[371,129][428,203] } from null (pid=-1, uid=10157) requires null
    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.startActivityLocked(ActivityManagerService.java:3223)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:3980)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:212)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:3843)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:210)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1480)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at android.os.Binder.execTransact(Binder.java:288)
    11-06 22:26:48.127: WARN/ActivityManager(85):     at dalvik.system.NativeStart.run(Native Method)

If i use,

Intent PlacesIntent1 = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName("com.facebook.katana", "com.facebook.katana.HomeActivity"));
            PendingIntent pendingIntent1 = PendingIntent.getActivity(context, 0, PlacesIntent1, 0);
            views.setOnClickPendingIntent(R.id.facebook, pendingIntent1);

Everything works great and it opens the home activity, but that's not really what i'm trying to do.

I've tried

com.facebook.katana.activity.places.PlacesNearbyActivity - I actually see a respons in the logcat about the denail with this one
com.facebook.katana.activity.PlacesNearbyActivity
com.facebook.katana.places.PlacesNearbyActivity
com.facebook.katana.PlacesNearbyActivity

and nothing happens with the others

Here's what i see in the logcat when manually opening the activities on my phone:

11-06 20:20:38.295: INFO/ActivityManager(85): Starting activity: Intent { cmp=com.facebook.katana/.activity.places.PlacesNearbyActivity }

11-06 22:03:28.027: INFO/ActivityManager(85): Starting activity: Intent { flg=0x4000000 cmp=com.facebook.katana/.HomeActivity }

So, that gives you sort of an idea how i got my information.

解决方案

I have a button on a widget that i need to open the "places" activity in the official facebook app.

Since it appears that Facebook does not endorse integration with their Android application this way, please do not do this.

Permission denied: checkComponentPermission() reqUid=10055

That activity can only be started by Facebook.

这篇关于拒绝许可的意图外部活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆