Code example for File

Methods: fromFile

    public static class Scanner { 
        // after writing the file to sd, invoke this to scan a single file without callback 
        public static Uri scan(Context aContext, String aPath) {
            File file = new File(aPath);
            Uri uri = Uri.fromFile(file);
            Intent scanFileIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
            return uri;
    public static class Viewer { 
        public static void viewImage(Context aContext, Uri aUri) {
            view(aContext, aUri, "image/*");
        public static void view(Context aContext, Uri aUri, String aMime) {
            Intent intent = new Intent();