1
私はアンドロイドアプリを通じてFacebookに画像ビットマップを共有しようとしています。私はGoogleで見つけたいくつかのコードを試みたが、成功を得ることができませんでした、ここに私のコードイメージを共有する方法アンドロイドでFacebookのビットマップ?
shareButton = (ShareButton) findViewById(R.id.share_btn);
//share dialog
AlertDialog.Builder shareDialog = new AlertDialog.Builder(this);
shareDialog.setTitle("Share Miimoji");
shareDialog.setMessage("Share Miimoji to Facebook?");
shareDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//share the image to Facebook
ByteArrayOutputStream baos = new ByteArrayOutputStream();
mSelectedMiimoji.GetBitmap().compress(Bitmap.CompressFormat.PNG, 20, baos);
SharePhoto photo = new SharePhoto.Builder().setBitmap(mSelectedMiimoji.GetBitmap()).build();
SharePhotoContent content = new SharePhotoContent.Builder().addPhoto(photo).build();
shareButton.setShareContent(content);
counter = 1;
shareButton.performClick();
}
});
shareDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
shareDialog.show();
がある私を助けてください。 ありがとうございます。
'のFacebook上の画像のビットマップを'共有しようとしています。試してみてください。 Facebookはそのビットマップを処理できません。助けが必要な場合は事前に感謝しないでください。 – greenapps