what should do is the following :
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"
+ Environment.getExternalStorageDirectory())));
right after your code .
provides a way for applications to pass a newly created or downloaded media file to the media scanner service.