[在Android中拍摄照片时如何启用本机编辑图像?

问题描述 投票:0回答:1

[当我使用本机照相机拍摄照片时,得到了以下信息:enter image description here

当我单击它时,它将显示一个编辑选项:enter image description hereenter image description here

但是,在我的应用程序中,当我调用意图使用以下代码打开相机并拍照时:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(intent, PICTURE_RESULT);

以某种方式,它不再显示该编辑选项。它仅提供检查和关闭图标:enter image description here

如果本机相机可以打开它,我相信应该有一种通过意图代码将其设置在那里的方法。

我知道并非所有的android手机都支持此功能。但是,至少,我想为具有此功能的人提供该编辑功能。

java android android-camera-intent
1个回答
0
投票

尝试一下Intent intent= new Intent(Intent.ACTION_EDIT); intent.setDataAndType(uri, "image/*"); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(Intent.createChooser(intent, null));但实际上最好的方法也是通过google camera API构建自己的相机应用]

© www.soinside.com 2019 - 2024. All rights reserved.