TedPermission
TedPermission copied to clipboard
[Android 10] WRITE_EXTERNAL_STORAGE Permission Denied
It used well in the existing API26, but it does not run after updating to Android 10. The TED Permission says that you have permission, but when you actually run the file save code, you get a Permission Denied.
So I am temporarily using the code below. The code below works fine.
String[] permissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE}; requestPermissions(permissions, 0); @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case 0: if(grantResults != null || grantResults.length != 0 || grantResults[0] == PackageManager.PERMISSION_GRANTED){ //Granted. Log.d(TAG, "PERM GRANTED"); } else{ //Denied. Log.d(TAG, "PERM DENIED"); } break; } }
You can use this code to verify that you have obtained the right permissions.
int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE);
if(permissionCheck == PackageManager.PERMISSION_DENIED){ Log.d(TAG, "PERMISSION DENIED"); }else{ Log.d(TAG, "PERMISSION GRANTED"); }
I am having same issue as @rlekqls12
https://developer.android.com/training/data-storage/compatibility
@rlekqls12 Did you check scoped storage?
AndroidManifest.xml
error: uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"
Success: uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"