Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); File f = new File(<新檔案名稱(含路徑)>); Uri contentUri = Uri.fromFile(f); mediaScanIntent.setData(contentUri); <your activity>.sendBroadcast(mediaScanIntent);
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); File f = new File(<新檔案名稱(含路徑)>); Uri contentUri = Uri.fromFile(f); mediaScanIntent.setData(contentUri); <your activity>.sendBroadcast(mediaScanIntent);