android.media.MediaScannerConnection.MediaScannerConnectionClient Java Examples

The following examples show how to use android.media.MediaScannerConnection.MediaScannerConnectionClient. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecorderVideoActivity.java    From FanXin-based-HuanXin with GNU General Public License v2.0 6 votes vote down vote up
public void sendVideo(View view) {
	if (TextUtils.isEmpty(localPath)) {
		EMLog.e("Recorder", "recorder fail please try again!");
		return;
	}

	msc = new MediaScannerConnection(this,
			new MediaScannerConnectionClient() {

				@Override
				public void onScanCompleted(String path, Uri uri) {
					System.out.println("scanner completed");
					msc.disconnect();
					setResult(RESULT_OK, getIntent().putExtra("uri", uri));
					finish();
				}

				@Override
				public void onMediaScannerConnected() {
					msc.scanFile(localPath, "video/*");
				}
			});
	msc.connect();

}