Android- how can I convert android.net.Uri object to java.net.URI object?
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
Found the correct way to open InputStream from content URI:
InputStream fileInputStream=yourContext.getContentResolver().openInputStream(uri);
That's all!