Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
img = (ImageView)findViewById(R.id.imageViewHinh);
img.setImageBitmap(photo);
}
}
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
img = (ImageView)findViewById(R.id.imageViewHinh);
img.setImageBitmap(photo);
}
}

No comments:
Post a Comment