Get/pick an image from Android's built-in Gallery app programmatically

前端 未结 19 1149
终归单人心
终归单人心 2020-11-22 00:49

I am trying to open an image / picture in the Gallery built-in app from inside my application.

I have a URI of the picture (the picture is located on the SD card).

19条回答
  •  离开以前
    2020-11-22 01:16

    Just in case it helps; I do this to get the Bitmap:

    InputStream is = context.getContentResolver().openInputStream(imageUri);
    Bitmap bitmap = BitmapFactory.decodeStream(is);
    

提交回复
热议问题