1

I need to create a folder named .ext.maps_common@transit etc. (untar archieve at other folder), I tried to use mkdir (), mkdirs (), trailing slash at its end and so on, but with no results. My final code is quite simple:

File dir = new File (".ext.maps_common@transit");
if (!dir.isDirectory ()) dir.mkdirs ();

Is it really to do this? Any help will be appreciated.

Acuna
  • 1,741
  • 17
  • 20

1 Answers1

1

try this,

 File dir = new File(Environment.getExternalStorageDirectory(), ".ext.maps_common@transit");
    if (!dir.exists()) {
        dir.mkdirs();
    }

and change Environment.getExternalStorageDirectory() to wherever location you want to create the directory. Don't forget to add neccessery permissions.

shinilms
  • 1,494
  • 3
  • 22
  • 35
  • Thanks, seems it working all this time, but not shown in my file explorer. It was nessessary for me to reboot it to see it. So strange... – Acuna Jun 10 '17 at 16:58