I am trying to create a folder that users can put stuff in and use in the app so I do this
File exportDir = new File(Environment.getExternalStorageDirectory()+"/BCAData");
if (!exportDir.exists()) {
exportDir.mkdirs();
}
File file = new File(exportDir, dbFile.getName());
file.createNewFile();
If I use a file explorer program like Astro File Manager I see the folder fine but when I plug the device into my PC the folder is not there to put stuff in.
is there something else that I have to do for it to be used on a PC?
At minimum, you need to get
MediaStoreto update its index, such as viascanFile()onMediaScannerConnection, as I outline in this blog post.Depending on your PC’s operating system (and possibly depending on the device), you may still not see changes while the device is plugged in. It appears that the PC does not necessarily “see” changes, even with the index updated, until you unplug and plug the device back in.