For some reason I am getting a fileNotFoundException
for both the times I read. Something worth noting is that the Toast prints \"File exists!\". I used the
You have already created a File
instance with File file = getActivity().getFileStreamPath(filename);
which is the instance that you are checking with the file.exists()
method. Then you are trying to read another thing with the FileInputStream
. You should try FileInputStream fileInputStream = new FileInputStream(file);
. With that you are creating your stream with the file that you already checked.