I have an android app that exports files to my device's internal storage (specifically /storage/emulated/0 via getExternalStorageDirectory() ) so that I can copy it over to PC via usb/windows file explorer. However, windows file explorer doesn't recognize changes to internal storage until I restart my device. For instance, if the app adds a new file, it will be immediately viewable in my devices storage settings, but if I then plug it into my computer it doesn't show up in file explorer. Restarting my device is the only way I can currently get file explorer to show changes to internal storage. Is there any way I can circumvent having to constantly restart my device to copy over files?
Asked
Active
Viewed 1,940 times
2
-
https://stackoverflow.com/questions/32789157/how-to-write-files-to-external-public-storage-in-android-so-that-they-are-visibl – CommonsWare Aug 03 '17 at 20:30
-
Also note that you are referring to [external storage](https://commonsware.com/blog/2014/04/08/storage-situation-external-storage.html), not [internal storage](https://commonsware.com/blog/2014/04/07/storage-situation-internal-storage.html). – CommonsWare Aug 03 '17 at 20:30
-
@CommonsWare Thanks! It seems like that works for when I create a new file, but when file explorer still doesn't recognize when I overwrite an existing file – eagren Aug 04 '17 at 15:37
-
What exactly do you mean by "doesn't recognize"? – CommonsWare Aug 04 '17 at 15:38
-
Nevermind, I just had to reconnect the usb. Thanks for your help – eagren Aug 04 '17 at 18:21
-
If "doesn't recognize" means that your desktop OS file manager was not seeing the changes, you may need to do a "refresh" or similar operation in that file manager. In some environments, changes seem to get pushed over to the desktop (e.g., my Ubuntu 17.04 machine), but in other cases, your file manager needs to re-request the directory contents to find out about the changes. – CommonsWare Aug 04 '17 at 18:29
1 Answers
0
I found this related question on windowsphone stackexchange:
The android device only sends data to the PC when the USB cable is connected.
Solutions/workarounds include:
- re-plugging the USB cable (as you already found out in your comment)
- turning the device off and on in Windows device manager (removable devices)

Aldinjo
- 394
- 1
- 7
- 21