0

Please help.

I'm trying to create a File object using a directory path. Here is my code

String dirPath = "/app/src/main/res/xml/sample.xml";
File source = new File(dirPath);
Log.v("file test", "exists " + source.exists());

But the Log-message says that source (File object from my code sample) does not exist. But it does exist, I see it in my project structure.

Anton Prokopov
  • 639
  • 6
  • 27

1 Answers1

1

sample.xml must be placed in assets-folder in order for you to be able to access it.

hamada147
  • 495
  • 1
  • 8
  • 14