當前位置: 首頁>>代碼示例>>Java>>正文


Java MediaScannerConnection.disconnect方法代碼示例

本文整理匯總了Java中android.media.MediaScannerConnection.disconnect方法的典型用法代碼示例。如果您正苦於以下問題:Java MediaScannerConnection.disconnect方法的具體用法?Java MediaScannerConnection.disconnect怎麽用?Java MediaScannerConnection.disconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.media.MediaScannerConnection的用法示例。


在下文中一共展示了MediaScannerConnection.disconnect方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPostExecute

import android.media.MediaScannerConnection; //導入方法依賴的package包/類
@Override
protected void onPostExecute(Boolean b) {
    super.onPostExecute(b);
    if (b) {
        Toast.makeText(context, "Tag Edit Success", Toast.LENGTH_SHORT).show();
        mediaScannerConnection = new MediaScannerConnection(getContext(),
                new MediaScannerConnection.MediaScannerConnectionClient() {

                    public void onScanCompleted(String path, Uri uri) {
                        mediaScannerConnection.disconnect();
                    }

                    public void onMediaScannerConnected() {
                        mediaScannerConnection.scanFile(song.getmSongPath(), "audio/*");
                    }
                });
    } else {
        Toast.makeText(context, "Tag Edit Failed", Toast.LENGTH_SHORT).show();
    }
}
 
開發者ID:RajneeshSingh007,項目名稱:MusicX-music-player,代碼行數:21,代碼來源:TagEditorFragment.java

示例2: sendVideo

import android.media.MediaScannerConnection; //導入方法依賴的package包/類
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) {
					Log.d("log scanner completed");
					msc.disconnect();
					setResult(RESULT_OK, getIntent().putExtra("uri", uri));
					finish();
				}

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

}
 
開發者ID:macyuan,項目名稱:TAG,代碼行數:26,代碼來源:RecorderVideoActivity.java

示例3: connectMediaScan

import android.media.MediaScannerConnection; //導入方法依賴的package包/類
private void connectMediaScan(final String filename) {
    msc = new MediaScannerConnection(this, new MediaScannerConnectionClient() {

        @Override
        public void onScanCompleted(String path, Uri uri) {
            savedUri = uri;
            msc.disconnect();
            if (isNeedShare) {
                KakaoShare.shareImageKakao(MainImageActivity.this, uri);
            }
            isNeedShare = false;
        }

        @Override
        public void onMediaScannerConnected() {
            msc.scanFile(filename, "image/png");
        }
    });
    msc.connect();
}
 
開發者ID:g82,項目名稱:open-mygirl-android-gradle,代碼行數:21,代碼來源:MainImageActivity.java

示例4: connectMediaScan

import android.media.MediaScannerConnection; //導入方法依賴的package包/類
private void connectMediaScan(final String filename) {
    msc = new MediaScannerConnection(mActivity, new MediaScannerConnection.MediaScannerConnectionClient() {

        @Override
        public void onScanCompleted(String path, Uri uri) {
            msc.disconnect();
        }

        @Override
        public void onMediaScannerConnected() {
            msc.scanFile(filename, "image/png");
        }
    });
    msc.connect();
}
 
開發者ID:g82,項目名稱:open-mygirl-android-gradle,代碼行數:16,代碼來源:ImageSaveTask.java

示例5: scanPhoto

import android.media.MediaScannerConnection; //導入方法依賴的package包/類
public static void scanPhoto(final String imageFileName) {

        msConn = new MediaScannerConnection(MyApplication.getInstance(), new MediaScannerConnection.MediaScannerConnectionClient() {
            public void onMediaScannerConnected() {
                msConn.scanFile(imageFileName, null);
                Log.i("msClient objy", "connection established");
            }

            public void onScanCompleted(String path, Uri uri) {
                msConn.disconnect();
                Log.i("msClient Utility", "scan completed");
            }
        });
        msConn.connect();
    }
 
開發者ID:birdcopy,項目名稱:Android-Birdcopy-Application,代碼行數:16,代碼來源:FlyingFileManager.java


注:本文中的android.media.MediaScannerConnection.disconnect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。