I have an answer to this question. Despite using the above code, I 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())));
user1644532
source share