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
精彩评论