scan MediaStore File - Android Media

Android examples for Media:Media File

Description

scan MediaStore File

Demo Code


//package com.java2s;

import android.content.Context;

import android.media.MediaScannerConnection;

public class Main {

    public static void scanFile(Context context, String path,
            String mimeType,/*from w  w  w .j a v a  2s. co m*/
            MediaScannerConnection.OnScanCompletedListener callback) {
        scanFile(context, new String[] { path }, new String[] { mimeType },
                callback);
    }

    public static void scanFile(Context context, String[] paths,
            String[] mimeTypes,
            MediaScannerConnection.OnScanCompletedListener callback) {

        MediaScannerConnection
                .scanFile(context, paths, mimeTypes, callback);
    }
}

Related Tutorials