bevy / photo-editor-android

Photo Editor SDK contains a lot of features like edit, scale, rotate and draw on images like Instagram stories.
MIT License
548 stars 189 forks source link

REFRESH THE GALLERY #6

Open pkanyerezi opened 7 years ago

pkanyerezi commented 7 years ago

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.

jasolangi786 commented 6 years ago

please share the code you added @pkanyerezi

liauli commented 6 years ago
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

jasolangi786 commented 6 years ago

@liauli Thanks ❤

sreekanth100khere commented 5 years ago

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