title: How to share image Bitmap on facebook in android?
body: <p>I am trying to share an image bitmap on facebook through my android app. I tried some codes found on google, but couldn't get success,here is my code </p>
  
  <pre><code> 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();
  </code></pre>
  
  <p>please help me. 
  Thanks in advance.</p>