FolioReader / FolioReader-Android

A Java ePub reader and parser framework for Android.
BSD 3-Clause "New" or "Revised" License
2.24k stars 715 forks source link

Unable to open file from internal storage #384

Open benthemobileguy opened 5 years ago

benthemobileguy commented 5 years ago

I saved a file to my internal storage with this path: file = getFileStreamPath(fileName); I am attempting to access the file with this line of code but it keeps returning null each time:

try{ File file = getFileStreamPath(fileName); folioReader.openBook(file.getAbsoluthPath); Log.e("file: ", "file: " + filePath); } catch (Exception e){ e.printStackTrace(); } }

nphausg commented 5 years ago

Which is your getFileStreamPath? Can you describe more clearly

benthemobileguy commented 5 years ago

I finally resolved my issue. I discovered from my device file explorer that my files were saved as .txt instead of .epub extension. After converting them, it worked smoothly with this code:

var path: String = context.getFilesDir().getAbsolutePath()

Thanks for your effort!