photo-editor-android icon indicating copy to clipboard operation
photo-editor-android copied to clipboard

REFRESH THE GALLERY

Open pkanyerezi opened this issue 7 years ago • 4 comments

Hey,

Thank you very much for this library it's the best free photo editor around. Am using it in an app but i had to add some code to refresh the device gallery after saving the image otherwise one has to first restart their device in order to see the saved image.

pkanyerezi avatar Jul 21 '17 11:07 pkanyerezi

please share the code you added @pkanyerezi

jasolangi786 avatar Nov 27 '17 12:11 jasolangi786

MediaScannerConnection.scanFile(context,
                    new String[]{file.getAbsolutePath()}, null,
                    new MediaScannerConnection.OnScanCompletedListener() {
                        public void onScanCompleted(String path, Uri uri) {
                            Log.i("ExternalStorage", "Scanned " + path + ":");
                            Log.i("ExternalStorage", "-> uri=" + uri);
                        }
                    });

This is how I refresh gallery. Just like pkanyerezi said, needs to be called after saving image. hope this helps someone

liauli avatar Jan 03 '18 07:01 liauli

@liauli Thanks ❤

jasolangi786 avatar Jan 03 '18 11:01 jasolangi786

@liauli , @jasolangi786 Please point to the specific line in the code where we should be putting the code snippet that is shared above.

sreekanth100khere avatar Mar 26 '19 10:03 sreekanth100khere