Code example for MediaScannerConnection

Methods: disconnect, isConnected

0
	/** 
	 * Disconnect the scanner. 
	 */ 
	public void disconnect() { 
		if (null != mMediaScannerConnectionObj
				&& mMediaScannerConnectionObj.isConnected()) {
			LogUtils.i(TAG, "disconnect requested");
			mMediaScannerConnectionObj.disconnect();
			mMediaScannerConnectionObj = null;
			mCallback = null;
		} 
	} 
 
	/** 
	 * Prepare media scanner object before starting scanning. 
	 */ 
	private void prepareMediaScanner() { 
		if (null != mContext) {
			mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri
					.parse("file://"
							+ Environment.getExternalStorageDirectory())));