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 ... Hope it's helpful! 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); }
Comments
Post a Comment