20151007_ manually refresh the Android system SD card

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.