views:

280

answers:

2

Hi! I am using MediaStore.Images.Media.insertImage(ContentResolver cr, String imagePath, String name, String description) function to insert a newly created image into gallery. System is naming the file by default, but its diferent than names of pictures taken by orginal app(Time stamp). Is there easy way to set it up?

A: 

According to the reference, insertImage returns the URL:

Returns
      The URL to the newly created image

Did it not work?

Roman Nurik
A: 

I use something like this

Uri u;
File fi = new File("/sdcard/tmp");
try {
    u = Uri.parse(android.provider.MediaStore.Images.Media.insertImage(getContentResolver(), fi.getAbsolutePath(), null, null));
    imageSaveName1 = u.toString();

}

imageSaveName1 looks something like "content://media/external/images/media/159"

davehale23