Android- how can I convert android.net.Uri object to java.net.URI object?

前端 未结 5 1452
一整个雨季
一整个雨季 2020-11-30 02:41

I am trying to get a FileInputStream object on an image that the user selects from the picture gallery. This is the android URI returned by a

5条回答
  •  醉话见心
    2020-11-30 03:15

    Found the correct way to open InputStream from content URI:

    InputStream fileInputStream=yourContext.getContentResolver().openInputStream(uri);
    

    That's all!

提交回复
热议问题