Android : How can i share bitmap in facebook in android?

on Saturday, January 31, 2015


In my app sharing bitmap to facebook .Link,description,message and imageurl all posting the facebook well but bitmap not share to facebook. I am using the following code:



Bitmap bi = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 20, baos);
byte[] data = baos.toByteArray();



if ( friend_uid != null ) {
final Activity activity = SocialSharingActivity.this;
Bundle params = new Bundle();
params.putString("name", "pictabsample");
params.putByteArray("picture",data);
//// params.pu
params.putString("to", friend_uid);
//
WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(SocialSharingActivity.this, Session.getActiveSession(), params))
.setOnCompleteListener(new OnCompleteListener() {

@Override
public void onComplete(Bundle values,
FacebookException error) {

}}).build();
feedDialog.show();
}


where i done mistake didn't findout.please tell me anyone known advance thanks to all


0 comments:

Post a Comment