I have an interface to record and play the videos. After recording a new video it is not updated to media store. The same problem I am facing while deleting a recorded file.
My question is:
How I can update the media store after adding or deleting a video file in a specific d开发者_运维技巧irectory.
Thanks, Dipesh
Add this line after save or delete function
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
See the MediaScannerConnection
's scanFile
method: http://developer.android.com/reference/android/media/MediaScannerConnection.html
精彩评论