Android通知媒体更新

Android通知媒体更新,writeToSD.getPath()文件全路径.

    Intent mediaScanIntent = new Intent(
    Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    File file = new File(writeToSD.getPath());
    Uri contentUri = Uri.fromFile(file);
    mediaScanIntent.setData(contentUri);
    sendBroadcast(mediaScanIntent);

你可能感兴趣的:(Android通知媒体更新)