用Android Studio走老师代码程序就崩了,权限都已经配置了
08-09 21:31:07.895 22138-22138/com.example.a25242.contentproviderdemo E/AndroidRuntime: FATAL EXCEPTION:main Process:com.example.a25242.contentproviderdemo, PID: 22138 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.a25242.contentproviderdemo/com.example.a25242.contentproviderdemo.MainActivity}: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{a980a9b 22138:com.example.a25242.contentproviderdemo/u0a168} (pid=22138, uid=10168) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483)
at android.app.ActivityThread.access$900(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5438)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{a980a9b 22138:com.example.a25242.contentproviderdemo/u0a168} (pid=22138, uid=10168) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3553)
at