I tryed many solutions in the forum but they do not seem to work. I need to create a pdf in my phone (Environment.getExternalStorageState() +File.separator +"Try" +File.separator +"FirstPdf.pdf";) but i have an exception.
I use verifyStoragePermissions(this)
and
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
in the manifest.
Asked
Active
Viewed 336 times
0

SkyEeros
- 1
- 2
-
https://stackoverflow.com/questions/32635704/android-permission-doesnt-work-even-if-i-have-declared-it – CommonsWare Jun 20 '16 at 13:16
-
on which device are you working? – Pramod Waghmare Jun 20 '16 at 13:18
2 Answers
0
Replace Environment.getExternalStorageState()
to Environment.getExternalStorageDirectory()
.

diogojme
- 2,309
- 1
- 19
- 25
0
Try this
File file = new File(Environment.getExternalStorageDirectory() +File.separator +"Try" +File.separator +"FirstPdf.pdf");\
// here your logic for write pdf file
Note:
you are trying getExternalStorageState()
and it will
Returns the current state of the primary shared/external storage media
.
Refer: External storage state

Pramod Waghmare
- 1,273
- 13
- 21