Code example for MediaScannerConnection

Methods: scanFile

0
 
    public void onMediaScannerConnected() { 
        mConnection.scanFile(mFile.getAbsolutePath(), null);
    } 
 
    public void onScanCompleted(String path, Uri uri) {
        try { 
            if (uri != null) {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(uri);
                mContext.startActivity(intent);
            } 
        } finally { 
            mConnection.disconnect();
        } 
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE