Android ACTION_GET_CONTENT does not update downloa

2019-04-05 11:02发布

I am facing an issue while choosing a file from Downloads directory using ACTION_GET_CONTENT.

If I delete any file in ES explorer or file manager in my local storage, those deleted files aren't removed in downloads dir while opening in my app.

Any changes in downloads dir dosen't get reflected in chooser.

To choose a file I am using the below library

https://github.com/iPaulPro/aFileChooser.

Here I attach my screenshot please have a look:

enter image description here

1条回答
Evening l夕情丶
2楼-- · 2019-04-05 11:16

You must have to call getContentResolver().delete(uri, null, null) while deleting the file, where uri is the URI of the file to delete. This will update Media Store, which holds URIs of all files. So, when ACTION_GET_CONTENT opens the downloads directory, the file you deleted won't appear here.

查看更多
登录 后发表回答