Android- how can I convert object to object?

You could use the toString method of the android Uri in combination of the String based constructor of the Java URI. auri = new ever); juri = new;

Android URI |
Java URI

Found the correct way to open InputStream from content URI:

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

That’s all!

There is a solution to your original question (convert Uri to URI):

  1. Get the real file path (look this code: Get filename and path from URI from mediastore)

  2. Get the URI using the real path and the constructor: URI(String uri)

If you need more details, look here:

How to delete a video recorded using an Intent with ACTION_VIDEO_CAPTURE?

Leave a Comment