Android account for Facebook

I have some problems with the code below. This code works for email, messages, Twitter (for sending text), but not for Facebook. Why?

Intent i=new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(android.content.Intent.EXTRA_SUBJECT,"ScribeAir");
i.putExtra(android.content.Intent.EXTRA_TEXT, "ScribeAir has some cool features. Just use it...");
startActivity(Intent.createChooser(i,"Share"));
+1
source share
4 answers

this does not work for facebook, because Facebook can only use the link through ACTION_SEND. if u wants to send the text as well as the link.

First, you need to get a list of installed applications that support ACTION_SEND, then build a dialog

  Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
    sharingIntent.setType("text/plain");
    List activities = getPackageManager().queryIntentActivities(sharingIntent,0);

, , . facebook facebook api, , , , .

Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); 
                sharingIntent.setClassName(,);
                sharingIntent.setType("text/plain");
                sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"hello");
                sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "facebook"); 
0
            Intent sharing = new Intent(android.content.Intent.ACTION_SEND); 
            sharing.setClassName(,);
            sharing.setType("text/plain");
            sharing.putExtra(android.content.Intent.EXTRA_SUBJECT,"hello");
            sharing.putExtra(android.content.Intent.EXTRA_TEXT, "yahoomail");
0

, .

As I know, Facebook does not allow pre-filling text through Intent , unlike Twitter / Email. This is the default. But with the SDK for Facebook, we can share the text as a link.

Refer to the Facebook SDK document sharing

0
source

try the following:

i.setType("message/rfc822");
-7
source

All Articles