如何从OI文件管理器路径获取位图图像?

Vik*_*kas 1 android

我的应用程序需要从图库中选择图像.

我开始活动:

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), PICK_IMAGE);
Run Code Online (Sandbox Code Playgroud)

它将提示从库或OI文件管理器中进行选择

对于OI文件管理器,我从Uri获取如下路径:

Uri selectedImageUri = data.getData();
filemanagerstring = selectedImageUri.getPath();
Run Code Online (Sandbox Code Playgroud)

现在我如何从filemanagerstring获取位图图像?

Fra*_*ita 9

你可以用这个:

BitmapFactory.decodeFile(String pathName);

看看这里