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

前端 未结 5 1449
一整个雨季
一整个雨季 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:35

    You could use the toString method of the android Uri in combination of the String based constructor of the Java URI.

    android.net.Uri auri = new android.net.Uri(what ever);
    java.net.URI juri = new java.net.URI(auri.toString());
    

    Android URI | Java URI

提交回复
热议问题