Uri.FromFile(File) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a Uri from a file.
[Android.Runtime.Register("fromFile", "(Ljava/io/File;)Landroid/net/Uri;", "")]
public static Android.Net.Uri? FromFile (Java.IO.File? file);
[<Android.Runtime.Register("fromFile", "(Ljava/io/File;)Landroid/net/Uri;", "")>]
static member FromFile : Java.IO.File -> Android.Net.Uri
Parameters
- file
- File
Returns
a Uri for the given file
- Attributes
Exceptions
if file is null
Remarks
Creates a Uri from a file. The URI has the form "file://<absolute path>". Encodes path characters with the exception of '/'.
Example: "file:///tmp/android.txt"
Java documentation for android.net.Uri.fromFile(java.io.File)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.