3

我想通过我的应用在 facebook 中分享文本。我已经搜索并找到了以下代码

Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Content to share");
        PackageManager pm = getPackageManager();
        activityList = pm.queryIntentActivities(shareIntent, 0); 

这给了我所有支持的应用程序列表ACTION_SEND,我只想在 facebook 中分享。我怎样才能得到只有脸书?谁能帮我?

4

1 回答 1

0

ACTION_SEND doesnt work with facebook as Matt already commented. I posted a question about this a while ago

facebook's take on handling share intents - how to deal with it

So even if you manage to limit ACTION_SEND to only facebook - I doubt this is possible - it wouldnt help. So most likely using the facebook android sdk

https://github.com/facebook/facebook-android-sdk/

is your way to go.

于 2012-11-04T06:15:34.480 回答