6

I used the following code.

 Intent share = new Intent(android.content.Intent.ACTION_SEND);
    share.setType("text/plain");
    share.putExtra(Intent.EXTRA_SUBJECT, subject);
    share.putExtra(
            Intent.EXTRA_TEXT,
            "i have just visited http://www.google.com");
    startActivity(Intent.createChooser(share,
            "Share Sydneyho! with your friends via"));

When i select gmail its showing what is written in Intent.EXTRA_TEXT but when i am selecting facebook its entirely different message and i don't know from where its comes from.

please help!

Akram
  • 7,548
  • 8
  • 45
  • 72
  • what do you mean by "not getting proper text" ? – Ovidiu Latcu Feb 14 '12 at 13:19
  • 1
    By proper text i mean to say its showing different message in different application.means when i select gmail its showing what is written in Intent.EXTRA_TEXT but when i am selecting facebook its entirely different message. – Akram Feb 14 '12 at 14:11
  • 2
    There are many similar question in here waiting for same answer [here is one](http://stackoverflow.com/questions/8706996/android-content-intent-action-send-facebook-does-not-receive-the-string) –  Feb 18 '12 at 06:53
  • 1
    thanks for answer not what i wanted but atleast someone given an answer good to see. – Akram Feb 18 '12 at 06:58
  • Here's a similar post for your reference. It looks like that you could only send a pure URL to facebook, but not mixing the text and URL. [Share Text on Facebook from Android App via ACTION_SEND](http://stackoverflow.com/questions/3515198/share-text-on-facebook-from-android-app-via-action-send) ----------------------------- This issue has been fired to the official facebook bug list long time ago. But it still not solved. [Bug 16728 - Android ACTION_SEND is not handled correctly](http://bugs.developers.facebook.net/show_bug.cgi?id=16728) – dong221 Feb 20 '12 at 14:08
  • thanks buddy i went through that post too but my requirement is to pass some text too. – Akram Feb 20 '12 at 14:11

2 Answers2

0

I have used the following code snippet to share Message with Action_Send to other apps.

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra("android.intent.extra.SUBJECT", "");
sharingIntent.putExtra("android.intent.extra.TEXT", "ABC");
startActivity(Intent.createChooser(sharingIntent, "Share using"));

And it works fine in my device(Android 2.2). Conceptually I dont know what is different between your code and above. But the above code works fine for me.

MKJParekh
  • 34,073
  • 11
  • 87
  • 98
-1

Got some similar posts here at stackoverflow and come to this conclusion we cant pass text in

 share.putExtra(Intent.EXTRA_TEXT,"bla bla bla");

to make it visible on facebook share page but we have to pass link to a website.

Akram
  • 7,548
  • 8
  • 45
  • 72