0

Do you know why it does not recognize my path?

Uri path = Uri.fromFile(new File("assets/test.xml"));  // tried with "file:///android_asset/test.xml"  
String fileIn = path.getPath();  
FileInputStream fis = new FileInputStream(fileIn);

I get a FileNotFound error at the end, the fis variable.

Thank you very much.

1

1 Answer 1

0

getAssets() will return you the asset folder. You get read a file by

InputStream in = getAssets().open("test.xml");

if you are doing this our of Activity. Then you need to call context.getAssets();

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.