10

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

mhatch
  • 4,441
  • 6
  • 36
  • 62
Pans
  • 199
  • 17
  • It seems like no problem with your code, problem with device, so check in other device and if same issue then type your code here for file picker. – Vickyexpert Jun 20 '16 at 06:58
  • Ok let me have a look on it and get back to it. – Pans Jun 20 '16 at 06:59
  • @Vickyexpert no in other devices also it remains the same it does not reflect in download dir outside not inside internal storage,please have a look on my screenshot. – Pans Jun 20 '16 at 07:09
  • You want to send file to after choosing file? – Pramod Waghmare Jun 23 '16 at 04:37
  • I also facing same problem. It seems like media-scanner should have to be triggered as it is not updating Directory. And note that if I add a new File to Downloads directory, then it appears but along with that old deleted file. I don't know why that file is shown there if it doesn't exist. – Meet Vora Aug 19 '16 at 10:14

1 Answers1

-1

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.

Keval Patel
  • 592
  • 3
  • 13
  • 1
    i am not asking for deleting the file inside the app my problem is if i delete any file outside in my local storage for (eg:ES Explorer) in download dir then go to my app and their if i open the download dir with ACTION_GET_CONTENT their i can see the deleted file in list. – Pans Jun 27 '16 at 06:46