yasserbn
yasserbn

Reputation: 391

Share Android app on Facebook with an image icon

I put a button to share my Android app on Facebook, so I wrote the following code

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
// add the app link
intent.putExtra(Intent.EXTRA_TEXT, "http://play.google.com/store/apps/details?  id=com.phonelight.realparrot");
startActivity(Intent.createChooser(intent, "Share with Facebook"));

After sharing, I opened my Facebook account and saw the following:

image

As you can see, It should be an image in the right square. I am wondering how can I put that image, I am thinking to put my icon app

Like if you share a youtube link, the image will be the first shot of the movie.

Upvotes: 1

Views: 1158

Answers (1)

Muhammad Korany
Muhammad Korany

Reputation: 92

Change intent.setType("text/plain"); to intent.setType("image/*"); then add intent.putExtra(Intent.EXTRA_STREAM, myImageContentUri);

Upvotes: 1

Related Questions