小编Fel*_*ann的帖子

Android 相机 Intent 图像未上传到 Webview 中

我得到一个 takePictureIntent ,它不为空,但它不会将其发送到网络视图。有人有想法吗?它确实适用于旧版本 9 及以下版本,但不适用于 Android 版本 10 和 11。

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
            // Create the File where the photo should go

            File photoFile = null;
            try {
                photoFile = createImageFile();
                takePictureIntent.putExtra("PhotoPath", mCameraPhotoPath);
                Log.d("test", "Test1");

            } catch (IOException ex) {
                // Error occurred while creating the File
                Toast.makeText(getApplicationContext(), "\"Unable to create Image File", Toast.LENGTH_SHORT).show();

            }

            // Continue only if the File was successfully created
            if (photoFile != null) {
                mCameraPhotoPath = "file:" + …
Run Code Online (Sandbox Code Playgroud)

android android-10.0 android-11

8
推荐指数
0
解决办法
1346
查看次数

标签 统计

android ×1

android-10.0 ×1

android-11 ×1