Code example for MediaScannerConnection

Methods: disconnect

0
            Log.d(TAG, "Connected to media scanner, scanning " + mScreenshotFile); 
            mConnection.scanFile(mScreenshotFile, null); 
        } 
    }; 
 
    void takeScreenshot(final int delay) {
        mHander.postDelayed(new Runnable() {
            @Override 
            public void run() { 
                takeScreenshot(); 
            } 
        }, delay * 1000);
    } 
}