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
  • 631
  • 4
  • 25

1 Answers1

1

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

hamada147
  • 463
  • 1
  • 10
  • 14