0

I am posting a bitmap image to instagram feed from my android app on pressing share button and it is giving me the exception of Transaction too large parcel size 77000 bytes

currently doing this , "bm" is my bitmap saved in local storage

ByteArrayOutputStream out = new ByteArrayOutputStream();
        bm.compress(Bitmap.CompressFormat.PNG, 40, out);
        Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray()));

        String path = MediaStore.Images.Media.insertImage(getContentResolver(),
                decoded, "", null);

        Uri uri = Uri.parse(path);

        Intent share = new Intent(Intent.ACTION_SEND);
        share.setType("image/*");
        share.putExtra(Intent.EXTRA_STREAM, uri);
        share.putExtra(Intent.EXTRA_TEXT, "");
        startActivity(Intent.createChooser(share, ""));
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
anu saini
  • 102
  • 9
  • https://stackoverflow.com/questions/48453172/transactiontoolargeexception-even-when-file-size-is-super-small – ADM Mar 15 '20 at 08:03
  • when i am adding that line of clearing the bundle , it is giving me null pointer exception!! – anu saini Mar 15 '20 at 08:19

0 Answers0