小编asa*_*lah的帖子

从相机捕获图像不适用于 Android 10 操作系统

我之前已经在 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)

java android android-10.0

5
推荐指数
0
解决办法
2407
查看次数

标签 统计

android ×1

android-10.0 ×1

java ×1