从其他应用程序启动Facebook应用程序 [英] launch facebook app from other app

查看:183
本文介绍了从其他应用程序启动Facebook应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能推出Android的从我的应用程序一个Facebook应用程序?

How can I launch a facebook app from my app in android?

推荐答案

要刚开始默认的启动活动:

To just start the default Launcher Activity:

Intent intent = new Intent("android.intent.category.LAUNCHER");
intent.setClassName("com.facebook.katana", "com.facebook.katana.LoginActivity");
startActivity(intent);

我做了一些研究,因为我想找到这一点:)。我找到了一些办法如何轻松地开始不同的活动。但我不能保证,这将脸谱升级后的工作。我与我目前的Facebook应用程序测试,它的工作原理。至少我用测试用亚行壳我就......。

I did some research, because I wanted to find this out :). I found some ways how to start different activities easily. But I can not guarantee that this will work after upgrades of facebook. I tested it with my current facebook app and it works. At least I tested it with "adb shell" using "am start .....".

基本是:

String uri = "facebook://facebook.com/inbox";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);

在facebook.com的部分不进行检查。你甚至可以输入:脸谱://gugus.com/inbox具有同样的效果。

the facebook.com part is not checked. you can even type: "facebook://gugus.com/inbox" having the same effect.

如何在亚行做到这一点。

How to do this in adb.

1. Start adb shell through console: "adb shell"
2. run: "am start -a android.intent.action.VIEW -d facebook://facebook.com/inbox"

这将启动收件箱中的活动。 这里是一些尤里斯结合的例子。我认为他们为自己说话他们做了什么。

this will start the inbox activity. Here some Uris with examples. I think they speak for themselves what they do.

facebook://facebook.com/inbox
facebook://facebook.com/info?user=544410940     (id of the user. "patrick.boos" won't work)
facebook://facebook.com/wall
facebook://facebook.com/wall?user=544410940   (will only show the info if you have added it as friend. otherwise redirects to another activity)
facebook://facebook.com/notifications
facebook://facebook.com/photos
facebook://facebook.com/album
facebook://facebook.com/photo
facebook://facebook.com/newsfeed

有可能是additianl参数,可以给你一定的这些URI的,但我没有时间去通过这些活动的所有code。

there might be additianl parameters you can give to certain of those uris, but I have no time to go through all the code of those activities.

我是怎么做到这一点?退房apktool。

How did I do this? check out apktool.

这篇关于从其他应用程序启动Facebook应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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