BÀI 29 - LẤY ẢNH CHỤP TRONG LẬP TRÌNH ANDROID
BÀI 29 - LẤY ẢNH CHỤP TRONG LẬP TRÌNH ANDROID
Video bài học:
int REQUEST_CODE_CAMERA = 123;
Intent intent = new Intent(MediaStore.ACTION_IMAGE_ACTION);
startActivityForResult( intent, REQUEST_CODE_CAMERA);
onAcitivityResult(){
if(requestCode == REQUEST_CODE_CAMERA && resultCode == RESULT_OK && data != null){
Bipmap bitmat = (Bitmap) data.getExtras().get("data"); //Key "data" là tên mặc định đừng đổi
ImageHinh.setImageBitmap(bipmap);
// Xin cấp quyền cho ứng dụng
}
}