In my application, I have a gallery with some images in it. When the user selects an image, I want to somehow get the identifier of the selected image.
int returned by getId () is -1. Why am I not getting the system identifier for the selected image?
gallery.setOnItemClickListener(new OnItemClickListener() {
@SuppressWarnings("rawtypes")
@Override
public void onItemClick(AdapterView parent, View v, int position, long id) {
int imageId = v.getId();
}
});
Thank!
plast source
share