我有一个应用程序,我使用相机意图捕获图像并将其用于进一步的目的,问题是我测试它的每一部手机(nexus 6p,HTC One m8,S5,redmi 1s)但在S4相机总是画像,捕捉图像后什么都不返回。以下是我使用的代码
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE_OWNER);
}
使用以下简单代码
获取图像protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_IMAGE_CAPTURE_OWNER && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
CircularImageView circularImageView = (CircularImageView)findViewById(R.id.imgViewParking);
circularImageView.setImageBitmap(imageBitmap);
mOwnerImage = imageBitmap;
}
}
不确定三星S4相机软件有什么问题,如何解决?