Media Store not working when folder programmatically created

前端 未结 1 1223
时光取名叫无心
时光取名叫无心 2020-12-11 11:01

I am accessing videos, from programmatically created folder, using following code But it returning cursor count 0, what should I do to solve this p

1条回答
  •  死守一世寂寞
    2020-12-11 11:35

    You should force the Android MediaStore to index created directory.

    String directoryPath = "file://" + Environment.getExternalStorageDirectory().getAbsolutePath() + "/smartVcall"
    sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(directoryPath)));
    

    0 讨论(0)
提交回复
热议问题