Querying MediaStore.Downloads for a file uploaded throught the Device Explorer (and thus created outside the App) returns nothing.
If the file is rather created via the .insert method by the App the same query returns the file as expected.
Is this some kind of permission issue there?
File location is = \Download\MyApp\MyFile.csv
String selection = MediaStore.Downloads.RELATIVE_PATH + " LIKE ? ";
// appfoldername = "MyApp"
String[] selectionArgs = new String[]{
'%' + Environment.DIRECTORY_DOWNLOADS + File.separator + appfoldername + '%'
};
Cursor cursor = resolver.query(MediaStore.Downloads.EXTERNAL_CONTENT_URI,
new String[] {MediaStore.MediaColumns.RELATIVE_PATH, MediaStore.MediaColumns._ID, MediaStore.MediaColumns.DISPLAY_NAME, MediaStore.MediaColumns.MIME_TYPE}, selection, selectionArgs, null);