打开拍照的意图:
Intent camera_intent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(camera_intent, ACTIVITY_CAMERA);
获取结果的活动:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if ((resultCode == RESULT_OK) && (requestCode == ACTIVITY_CAMERA)) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
my_image.setImageBitmap(photo);
data.putExtra("Camera", true);
}