Hi,
I created SD card image in android emulator.I can access the images from SD card as well as gallery.I want to import selected image in to my app.
I am attaching the method for clicking the image item used in my code.
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long rowId) {
Log.i(TAG,"onImageClick position= " + position + " rowId= "
+ rowId + " nCursor=" + mCursor.getCount());
try {
mCursor.moveToPosition(position);
long id = mCursor.getLong(mCursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails.IMAGE_ID));
//create the Uri for the Image
Uri uri = Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id+"");
selectImage = position;
//Uri selectedImage = intent.getData();
Intent intent = new Intent(Intent.ACTION_VIEW);
//intent = new Intent();
intent.setData(uri);
//intent.setClass(this,camera.class);
startActivity(intent);
Log.i("TAG","Pos :"+selectImage);
//startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),selectImage);
} catch (CursorIndexOutOfBoundsException e) {
Log.i(TAG, "CursorIndexOutOfBoundsException " + e.getStackTrace());
}
}
I want to import the clicked image in to different activity means in my app.
If Somebody have an idea,please help me out.


