当前位置: 首页>>代码示例>>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;未经允许,请勿转载。