I have an app that takes pictures and they are uploaded full-size. I want them to be shown in the gallery app. I'm using:
private void galleryAddPic() {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
File f = new File(imagepath);
Uri contentUri = Uri.fromFile(f);
mediaScanIntent.setData(contentUri);
this.sendBroadcast(mediaScanIntent);
}
It works in 5.0 but not in 4.3. The imagepath
is an absolute path
Try smthing like this...
This method will add your file to gallery using it's position, where mCurrentFilteredPhotoPath is a String object