android - How to add taken photo to MediaStore -


I want to add the photo that was moved to MediaStore so that the Gallery app can find them (without restarting the device) The minimum SDK is 9. Any help, blog or documentation appreciated.

On most devices, you just have to wait a little while and get new pictures automatically Will be imposed.

If you want to refresh instant from the gallery, you will have to use the Media Scanner class, this will refresh the gallery - Remove the deleted photos, add new ones and so on ... Public Zero Refresh Gallery () {Intention ScanIntent = New Intent (Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); String NewphotoPath = "File:" + image.getAbsolutePath (); // image file file file file file = new file (new photo pad); Uri content URI = Uri.framefile (file); ScanIntent.setData (contentUri); SendBroadcast (scanIntent); }

Hope it's helpful!

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -