Java tutorial
//package com.java2s; //License from project: Apache License import android.net.Uri; import java.io.File; public class Main { /** * Convert a file to a Uri * @param file * @return */ public static Uri convertFileToUri(File file) { if (file == null) { return null; } Uri imgUri = Uri.fromFile(file); return imgUri; } }