Hello people,
I am having a problem regarding mediastore.media.Images. I am trying
to populate a gallery with thumbnails from y sdcard, this works fine,
now i want to get the real image in an imageview onclick event.
Here is my code ,
private View loadGallery() {
// thumbnails
String[] proj = { MediaStore.Images.Thumbnails._ID };
cursor = managedQuery(
MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
proj, // Which
//
columns
//
to
//
return
null, // WHERE clause; which rows to return (all rows)
null, // WHERE clause selection arguments (none)
MediaStore.Images.Thumbnails.IMAGE_ID + " DESC"); //
Order-by clause
// (ascending
by IMAGE ID descending order)
column_index = cursor
.getColumnIndexOrThrow
(MediaStore.Images.Thumbnails._ID);
// Reference the Gallery view
// g = (Gallery) findViewById(R.id.galleryImg);
g = new Gallery(this);
// Set the adapter to our custom adapter (below)
g.setAdapter(new ImageAdapter(this));
// Set a item click listener, and just Toast the clicked
position
g.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v,
int position, long id) {
// Preview Image i can get the position on the image
Gallery
// how do i get the imagepath, or absolute path of the real image from
the thumnail?
}
});
return g;
}
Many Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---