0

I want to post a text on facebook without the facebook sdk.

I already see how can I share link with facebook

  Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
// intent.putExtra(Intent.EXTRA_SUBJECT, "Foo bar"); // NB: has no effect!
        intent.putExtra(Intent.EXTRA_TEXT, urlToShare);

// See if official Facebook app is found
        boolean facebookAppFound = false;
        List<ResolveInfo> matches = getActivity().getPackageManager().queryIntentActivities(intent, 0);
        for (ResolveInfo info : matches) {
            if (info.activityInfo.packageName.toLowerCase().startsWith("com.facebook.katana")) {
                intent.setPackage(info.activityInfo.packageName);
                facebookAppFound = true;
                break;
            }
        }

// As fallback, launch sharer.php in a browser
        if (!facebookAppFound) {
            String sharerUrl = "https://www.facebook.com/sharer/sharer.php?u=" + urlToShare;
            intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sharerUrl));
        }

        startActivity(intent);
    }

I want to do the same but with simple text.. What can I do ?

Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94

1 Answers1

1

I think that you can't really do this! I have a look at the following link, as it says it's a know bug and Facebook doesn't seem to care fixing it. Android and Facebook share intent

Community
  • 1
  • 1
Pavlos
  • 2,183
  • 2
  • 20
  • 27