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
getFilesDir
returns a File object. If you call onString on it (which you do implicitly), it returns its path. The path is not ending with a slash if the file is a directory, so getActivity().getFilesDir()+filename
will result in something like "/data/data/com.yourapp/filescalendar_recipes.txt"
.
You can either use getActivity().getFilesDir()+File.separator+filename
, or just call new FileInputStream(file)
.