This works as designed.

The getDataString() is the string of the content Uri that refers to
the image.
If you want the physical filename, do a 'Cursor cursor =
getContentResolver().query(intent.getData(), null, null, null, null)'
and query the column ImageColumns.DATA on the returned cursor.

The cursor.getString(ImageColumns.DATA) will return the physical file-
path on your SC-card.


On Mar 30, 3:58 pm, Bobbie <bobbie.st...@gmail.com> wrote:
> I am having issues with some "photo picker" code that I am using.  All
> of my pictures are stored on an SD card.  The SD card is mounted and I
> can take pictures no problem.  However, when I select a picture from
> the picker and output the location of the file, I should get:
>
> "/sdcard/dcim/Camera/FILENAME.jpg"
>
> But instead, I get:
>
> "content://media/external/images/media/7"
>
> Any ideas what could be causing this?  Here is my code, a button
> invokes the "takePic()" function:
>
> ================================
>
>     public void takePic() {
>         Intent photoPickerIntent = new Intent
> (Intent.ACTION_GET_CONTENT);
>         photoPickerIntent.setType("image/*");
>         startActivityForResult(photoPickerIntent, 1);
>     }
>
>     @Override
>     protected void onActivityResult(int i, int j, Intent intent) {
>         super.onActivityResult(i, j, intent);
>
>         textview.append(intent.getDataString());
>     }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to