Permission Denial for intent to external activity

喜欢而已 提交于 2019-12-04 19:13:29

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.

I disagree with Answer by CommonsWare. The answer is also not at all accepted, though I thought the answer is correct once, then I tried following code and found out that you can open place Activity from another app using following code...

appAction = Intent.ACTION_VIEW;
appPackage = "com.facebook.katana";
appActivity = "com.facebook.katana.IntentUriHandler";

data = Uri.parse("facebook:/places").buildUpon().appendQueryParameter("user", Long.toString(post.getSourceId())).appendQueryParameter("post", post.getPostId()).build();

Intent intent = new Intent(appAction);
intent.setClassName(appPackage, appActivity);

intent.setData(data);
ctx.startActivity(intent);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!