0

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.

TomTom
  • 51
  • 6

2 Answers2

2

The aim is to save pdf file to internal downloads folder

Use Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), not getFilesDir(). Also:

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
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