I have a problem trying to get MediaScanner to scan just one directory.
My app takes pictures, and saves them to sd-card/DCIM/AppPictures/, and obviously I need to invoke the MediaScanner for them to show up in the gallery app. The following code DOES work for my purpose:
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));
But it just seems so wasteful! I don't want to use resources trying to scan the whole SDcard when I know exactly where the files are. I have tried the following too:
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory+"/DCIM/AppPictures/")));
But this fails to yield any results. Can someone PLEASE let me know the proper way to get this done?