I am using general share intent for sharing news link containing image as well with other social sharing application installed in my phone.
The general share code is:
twitter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Utils.isNetworkAvailable(NewsDetailed.this)) {
// TODO Auto-generated method stub
Intent sendIntent = new Intent();
Intent i = getIntent();
sendIntent.setAction(Intent.ACTION_SEND);
String Title = i.getStringExtra("title");
String id = i.getStringExtra("id");
sendIntent.putExtra("android.intent.extra.TEXT", "http://www.mywesite.com/?p="+id);
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
else{
showToast("Can't Post in Offline mode");
}
}
});
this code works fine for google plus, twitter, pintrest, umano etc etc..
If I want to share my news with Facebook it also works fine for news having images attached as well.
But if there is no image attached with the news, it picks an image without any criteria from the shared web link instead of picking the default image. However if the same link is shared with other social share apps it works fine and picks the default image.
if anybody has any idea as to how to fix this Facebook issue, please let me know. My application is published on google play store https://play.google.com/store/apps/details?id=com.Almuqeet.risingkashmir.