Reputation: 1987
I'm building a share feature on my app which I got working using this
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, "URLyouWantToShare");
startActivity(Intent.createChooser(shareIntent, "Share..."));
As expected it opens a dialog with options to use a service to share. Right now I'm testing it on the emulator and I get the facebook option and the sms option. When I choose the sms option , the text "URLyouWantToShare" is transferred to the field where the user enters the message. However when I choose the facebook option, it opens up the view to share but the text is not transferred. How can I get the text transferred to Facebook to be shared?
Upvotes: 0
Views: 74
Reputation: 516
There is no way to fix that :( . I have tried it myself. Facebook, intentionally, for some reason, doesn't allow it. It should work, if you set ONLY a link, as text, but it won't work, just for text. Pretty annoying.
Upvotes: 1