I'm working on developing an android application for viewing dicom images which I have stored in an arrayList of Bitmaps, and I used a GridViewAdapter
to preview the images in a GridView
which is located in a fragment, then the user selects one image to see it in a new activity and that was done by implementing the onItemClickListner
.
When the user clicks on the first image it is shown correctly, but if any other image is choosen I get this error.
threadid=12: thread exiting with uncaught exception (group=0x40e6f930)
here is the onItemClickListener
implementation
class imageClickListener implements OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
try {
Bitmap selectedImage = cFindResult.get(arg2);
Intent i = new Intent(getActivity(), DicomImageActivity.class);
i.putExtra("Image", selectedImage);
ShowRadiologyRequestsFragment.this.startActivity(i);
} catch (Exception e) {
e.printStackTrace();
}
}
The cFindResult
is an ArrayList<Bitmap>
Is there anyone who can help me know what could be the problem?
Thanks.