How can I replace the bitmap image after rotating the original image stored any where in the mobile?

android, android-camera, database, media, replace

Solution

I have got answer of this question. Inspite of using above code I have used:

OutputStream fOut = null;
                File file = new File(imagePath);
                try {
                    fOut = new FileOutputStream(file);
                    } catch (FileNotFoundException e) {

                    e.printStackTrace();
                }
                resizeBitmap.compress(Bitmap.CompressFormat.JPEG, 85, fOut);

            //---------------Used Media Scanner-----------
                sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri
                        .parse("file://" + Environment.getExternalStorageDirectory())));

Problem

I want to replace the bitmap image after rotating it, from the original image stored any where in the mobile. I have rotated an image at 90 degree but I'm unable to replace it from that original image. ``` MediaStore.Images.Media.insertImage(getContentResolver(), rotatedBitmapImage, imageName, ""); ``` I have used above code but it is storing image in DCIM -> camera folder. But I want to replace it from URI of the original image.

Original source