I am capturing images using MediaStore.ACTION_IMAGE_CAPTURE intent. it is working fine in most of the devices. but it is not working correctly in some latest android device as expected.
my intention is capture image using camera and send it to the server but not to store that image in default gallery of the device.
**: When i capture image, it is returning some other gallery image in onActivityResult method instead of captured image in some latest android devices. I am using below code to capture and store images.
public void launchCamera(View v) {
Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(camera, CAMERA_PIC_REQUEST );
}
In onActivityResult method,
String[] projection = { MediaStore.Images.ImageColumns.SIZE,
MediaStore.Images.ImageColumns.DISPLAY_NAME,
MediaStore.Images.ImageColumns.DATA, BaseColumns._ID, };
Cursor c = null;
Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
try {
if (u != null) {
c = managedQuery(u, projection, null, null, null);
}
if ((c != null) && (c.moveToLast())) {
Bitmap thumbnail = getBitMapFromLocalPath(c.getString(2), 3);
idsImagesgot.add(thumbnail);
ContentResolver cr = getContentResolver();
cr.delete( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
BaseColumns._ID + "=" + c.getString(3), null);
}
} finally {
if (c != null) {
c.close();
}
}
Can any one help me out in this regards.
Thanks in advance.
Sathish