I am writing a media player application. I am showing all videos of my sd card in a grid view. It's working fine. If any one making changes to those videos(like rename, delete) using some other app like file expert or file manager are not not effecting my grid view. My grid still showing old names and deleted files. To resolve this i have added refresh button. In this i am using
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
Uri.parse("file://" + Environment.getExternalStorageDirectory())));
But this is ot supported in KITKAT version. Then after google, i got this solution Android How to use MediaScannerConnection scanFile But i don't know how to scan my sdcard with MediaScannerConnection on my refresh buttton click.