我之前已经在 android 应用程序中实现了一个图像,该图像在 Android 9 操作系统上运行良好,但突然停止在 Android 10 操作系统上工作。如果其他人面临同样的问题,请提出。
// open the camera from the user's phone
private void takePhotoFromCamera() {
Intent intent = new Intent(ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAMERA);
}
Run Code Online (Sandbox Code Playgroud)
// this code is writen in onActivityResult
if (requestCode == CAMERA) {
myProfileImage = (Bitmap) data.getExtras().get("data");
myImage.setImageBitmap(myProfileImage);
}
Run Code Online (Sandbox Code Playgroud)