you can use this function
private void doCrop(Uri mImageCaptureUri) {
this.mImageCaptureUri = mImageCaptureUri;
Intent intent = new Intent("com.android.camera.action.CROP");
// intent.setType("image/*");
intent.setDataAndType(mImageCaptureUri, "image/*");
List<ResolveInfo> list = getPackageManager().queryIntentActivities(
intent, 0);
int size = list.size();
if (size == 0) {
// Toast.makeText(this,
// "Can not find image crop section",Toast.LENGTH_SHORT).show();
return;
} else {
// Toast.makeText(this,
// "image crop section started..",Toast.LENGTH_SHORT).show();
intent.setData(mImageCaptureUri);
// Bitmap bitmap_1 = readBitmap(mImageCaptureUri);
try {
bitmap = MediaStore.Images.Media.getBitmap(
this.getContentResolver(), mImageCaptureUri);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}// = bitmap_1;
new MydataLoader().execute(function.sendimage);
// changed
intent.putExtra("outputX", 200);
intent.putExtra("outputY", 200);
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("scale", true);
intent.putExtra("return-data", true);
// Log.e("size",""+size);
if (size >= 1) {
// Toast.makeText(MerchantLogin.this,
// "Cropimage got called with size"+ size,
// Toast.LENGTH_SHORT).show();
Intent i = new Intent(intent);
ResolveInfo res = list.get(0);
i.setComponent(new ComponentName(res.activityInfo.packageName,
res.activityInfo.name));
startActivityForResult(i, CROP_FROM_CAMERA);
} else {
// Toast.makeText(MerchantLogin.this,
// "Cropimage not get called", Toast.LENGTH_SHORT).show();
}
}
}
To call crop action of camera used intent "com.android.camera.action.CROP"