Permission error in Android Studio

Asked

Viewed 678 times

-1

I’m adding a function in the application I’m developing in android studio, which makes direct links from the app, but this error is asking for some kind of permission, and I’ve already added permission in my Androidmanifest. erro

1 answer

1


Add this to your import:

import android.annotation.TargetApi;

String[] perms = {"android.permission.WRITE_EXTERNAL_STORAGE"};
ActivityCompat.requestPermissions(MainActivity.this,perms,permsRequestCode);

and enough.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.