Small problem, I am trying to save my PDF file in phone (LG G5 - no SD card), but file is never saved, is there a problem with file path? Using PdfBox-Android library. See picture from debugger - Debugger picture. The aim is to save pdf file to internal downloads folder. I tried 10x solutions, nothing is working. Please help.
Asked
Active
Viewed 1,190 times
2 Answers
2
The aim is to save pdf file to internal downloads folder
Use Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
, not getFilesDir()
. Also:
- You will need the
WRITE_EXTERNAL_STORAGE
permission - You will need to handle runtime permissions
- You will need to get the file indexed by the
MediaStore
before it will show up

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
Great, added runtime persmission and it works :) Thankyou! – TomTom Apr 02 '17 at 17:40
0
I think you are trying to run the code on M version. Please check for Write External Storage permission and other read and write permissions in manifest file. For Android M and above versions use the concept of runtime permissions.
Let, me know if it was helpful.

Aniket Jadhav
- 166
- 11