Code example for MediaScannerConnection

Methods: connect

0
    } 
 
    public static void invokeMediaScanner(Context context, File file) {
        L.d("invokeMediaScanner " + file.getAbsolutePath());
        SimpleScannerClient client = new SimpleScannerClient(file.getAbsolutePath());
        MediaScannerConnection connection = new MediaScannerConnection(context, client);
        client.setConnection(connection);
        connection.connect();
    } 
 
    private static class SimpleScannerClient implements 
            MediaScannerConnection.MediaScannerConnectionClient {
 
        private String mPath;
        private MediaScannerConnection mConnection;
 
        public SimpleScannerClient(String path) {
            mPath = path;
        } 
 
        public void setConnection(MediaScannerConnection connection) {