I have a saved a file in the root folder and am trying to open it in a webview.
This is my code for saving:
OutputStream outstream = null;
outstream = openFileOutput(fileName ,MODE_WORLD_READABLE);
/// if file the available for writing
if (outstream != null) {
/// prepare the file for writing
OutputStreamWriter outputreader = new OutputStreamWriter(outstream);
BufferedWriter buffwriter = new BufferedWriter(outputreader);
/// write the result into the file
buffwriter.write(result);
}
/// close the file
outstream.close();
} catch (java.io.FileNotFoundException e) {
System.out.println("File not found in the writing...");
} catch (IOException e) {
System.out.println("In the writing...");
}
This is my code for recalling the file:
fileView.getSettings().setJavaScriptEnabled(true);
fileView.loadUrl("file:///" + name); <---
and inside the app it gives me a file not found error.
Any insight is helpful.