5
strider
7y

!rant

Struggled for 2 hours now. How the heck can a create a directory on android. My code:
File dir = new File(Environment.getExternalStorageDirectory(), "Directory");
dir.mkdirs();

Comments
  • 0
    @TheGeekyGuy thats not the issue, i included the permissions.
  • 1
    What a coincidence! I just gave up on that just now!
  • 2
    As @TheGeekyGuy said. But if you're just playing around and don't want to add the code (i.e. you're sending some logs to file to check something and the permission will not be in real production app) you can just go to your app settings and give the permission by hand.
  • 0
    "File dir = new file"😲
  • 1
    @linuxxx I know it looks awful..
Add Comment