There was a problem with parsing bitmap in URI:
public static Uri getImageUri(Context c, Bitmap inImage){ ByteArrayOutputStream bytes = new ByteArrayOutputStream(); inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes); String result = MediaStore.Images.Media.insertImage(c.getContentResolver(), inImage, "", ""); return Uri.parse(result); }
This error occurs: java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content: // media / external / images / media from pid = 15574, uid = 10085 requires android.permission.WRITE_EXTERNAL_STORAGE or grantUriPermission ()
That is, my program does not have permission to write to External Storage, but ... I have it!
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Help the Chukchi programmer.