Under Android Studio, how to solve: java-Android problem, why I have written permission but still say I don't have permission

The problem describes
the Android problem, why I have written permission but still say I don't have permission
package="com.yjf.csu.readcontactpeople">

<uses-permission android:name="android.permission.READ_CONTACTS" />

<uses-permission android:name="android.permission.WRITE_CONTACTS" />
    The permissions I added to the manifest at this time

    Cursor cursor = contentResolver.query(uri, new String[]{"contact_id"}, null, null, null); //This is the error code

    Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{6b43e34 2995:com.yjf.csu.readcontactpeople/u0a61} (pid=2995, uid=10061)**requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS**


Solution
You need to check whether your targetSDkVersion is 23. If it is, you need to judge the permissions.
 Check whether the
 sdk set in <uses-sdk of 6.0 is 23, if it is 23, change it to 22.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326798576&siteId=291194637