Java Code Examples for android.content.Intent.ACTION_MEDIA_SCANNER_STARTED

The following are Jave code examples for showing how to use ACTION_MEDIA_SCANNER_STARTED of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Musicoco   File:   Source Code and License Vote up 6 votes
public void startScan() {
    IntentFilter intentfilter = new IntentFilter(Intent.ACTION_MEDIA_SCANNER_STARTED);
    context.registerReceiver(scanSdReceiver, intentfilter);

    String externalStoragePath = Environment.getExternalStorageDirectory().getPath();
    String path = externalStoragePath + "/";

    context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
            Uri.parse("file://" + path)));