android - getExternalFilesDir() returns null -


one of app's users has reported error in app, context.getexternalfilesdir(null) returns null.

i have added write_external_storage permission following.

<uses-permission      android:name="android.permission.write_external_storage"      android:maxsdkversion="18" /> 

i have used android:maxsdkversion="18" because android documentation says write_external_storage permission not necessary write directory returned context.getexternalfilesdir(null), starting android 4.4 (sdk 19).

but, if remove android:maxsdkversion="18" permission, context.getexternalfilesdir(null) returns non null value.

the device happens oppo find 7 android 4.4.2 (sdk version 19).

can explain why happens? should fix this? removing android:maxsdkversion="18" fixes problem, per documentation, permission unnecessary in later android versions.


Comments

Popular posts from this blog

C++: Boost interprocess memory mapped file error -

python - IO.UnsupportedOperation: Not Writable -

python - malformed header from script index.py Bad header -