开发者

How to get Bitmap image from OI file manager path?

开发者 https://www.devze.com 2023-02-03 05:08 出处:网络
My application requires an image to be selected from 开发者_如何学JAVAgallery. I start activity:

My application requires an image to be selected from 开发者_如何学JAVAgallery.

I start activity:

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

It will prompt to select from gallery or OI file manager

For the OI file manager, I get the path from Uri as follow:

Uri selectedImageUri = data.getData();
filemanagerstring = selectedImageUri.getPath();

Now how do I get Bitmap image from the filemanagerstring?


You can use this:

BitmapFactory.decodeFile(String pathName);

Look at here

0

精彩评论

暂无评论...
验证码 换一张
取 消