Issue background
During the ETTS project, the database file is written to the SD card as an intermediary medium for interacting with the computer; The problem occurs when the file is written to the SD card in the files on the mobile phone side of the file management system can be seen, but the use of USB cable to connect the computer after the new file is not displayed, the data update is not synchronized.
Problem description
SD card Data refresh is not timely.
Source of the problem
"Android system cache did not handle this" ... The specific reason is not clear ...
Workaround
(http://www.111cn.net/sj/android/44870.htm)
<1>. Scan the entire SD card via intent.action_media_mounted:
1 Public void 2 context.sendbroadcast (new Intent (intent.action_media_mounted, Uri.parse ("file:/ /"+3 }
<2>. Scan a file with Intent.action_media_scanner_scan_file:
1 Public void 2 Uri data = Uri.parse ("file://" +3 context.sendbroadcast (new 4 }
Note: filepath is the address of the file in the SD card, when the file is saved, call the above method; Sendbroadcast is a method of class context.
20151007_ manually refresh the Android system SD card