I have an android.net.URI object (the view returned by onActivityResult after MediaStore.ACTION_VIDEO_CAPTURE): it looks like content: // media / video / media / 33.
I want to convert this to a File object, and only a File object — I need to pass it to another constructor that needs a file.
How can I convert a URI like this to a File object? If i try
File newFile = new File(myURI);
I get an error in Eclipse asking me to convert a URI to a string. Supplying URI.getPath () in the constructor does not help either.
This applies to How to convert an android.net.uri object to a java.net.uri object? ?, unfortunately, unfortunately, the answer, but I need a File object, not a java uri.
I do not mind if I need to write it to the stream stream and vice versa - no matter what the best.
Sorry if I cross-post my own question , but I thought I might need to do something clearer.
AP257 source
share