标签:android mediascanner sdcard
Intent.ACTION_MEDIA_SCANNER_SCAN_FILE
“android.intent.action.MEDIA_SCANNER_SCAN_DIR”
<span style="font-size:14px;">sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(new File(path)))); sendBroadcast(Intent(“android.intent.action.MEDIA_SCANNER_SCAN_DIR”, Uri.(File(dir))));</span>
Intent.ACTION_MEDIA_SCANNER_FINISHED
<span style="font-size:14px;">IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); filter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED); registerReceiver(receiver, filter);</span>
sd卡被插入,且已经挂载 | Intent.ACTION_MEDIA_MOUNTED |
sd卡存在,但还没有挂载 | Intent.ACTION_MEDIA_UNMOUNTED |
sd卡被移除 | Intent.ACTION_MEDIA_REMOVED |
sd卡作为 USB大容量存储被共享,挂载被解除 | Intent.ACTION_MEDIA_SHARED |
sd卡已经从sd卡插槽拔出,但是挂载点还没解除 | Intent.ACTION_MEDIA_BAD_REMOVAL |
开始扫描 | Intent.ACTION_MEDIA_SCANNER_STARTED |
扫描完成 | Intent.ACTION_MEDIA_SCANNER_FINISHED |
标签:android mediascanner sdcard
原文地址:http://blog.csdn.net/matrix_laboratory/article/details/44223293