From 6d8259b54c8de61eb91528b2104d171403e3bf43 Mon Sep 17 00:00:00 2001 From: erlei Date: Tue, 20 Aug 2019 15:58:10 +0800 Subject: [PATCH] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过广播添加文件到媒体数据库 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6faf546..e815045 100644 --- a/README.md +++ b/README.md @@ -887,6 +887,12 @@ adb shell am stopservice [options] adb shell am broadcast [options] ``` +添加文件到媒体数据库: + +```sh +adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/Download/test2.png +``` + 可以向所有组件广播,也可以只向指定组件广播。 例如,向所有组件广播 `BOOT_COMPLETED`: