file Scan via Intent - Android android.content

Android examples for android.content:Intent

Description

file Scan via Intent

Demo Code

import com.mysql.jdbc.log.LogUtils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {

  public static void fileScan(final Context context, String file) {
    Uri data = Uri.parse("file://" + file);

    context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, data));
  }/*w  ww  . ja v a  2s. c o m*/

}

Related Tutorials