Files Drag and Drop into the Emulator are not listed in MediaStore query

Viewed 24

Dragged some files into android emulator from Windows Explorer. Now files are in /Downloads folder. MediaSore query NOT lists these files. Query result have all other files in Volume.

val uri = MediaStore.Files.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY)
val projection = arrayOf(MediaStore.Files.FileColumns.DISPLAY_NAME)
val cursor = contentResolver.query( uri, projection, null, null, null)

while (cursor.moveToNext()) {
  Log.e("Files", "name= "+ cursor.getString(0))
}

Restarting device also have no use. Files get listed on query only after rename with any file explorer.

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

permission is in manifest.

0 Answers
Related