从其他应用程序启动Facebook应用程序应用程序、Facebook

由网友(干戈挽惆怅)分享简介:我怎样才能推出Android的从我的应用程序一个Facebook应用程序?How can I launch a facebook app from my app in android?推荐答案要刚开始默认的启动活动:To just start the default Launcher Activity:Int...

我怎样才能推出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.

阅读全文

相关推荐

最新文章