我的代码是:
CursorLoader cursorLoader = new CursorLoader(getApplicationContext(), Uri.parse("content://com.example.umang.cr.StudentProvider/students"), null, null, null, null);
Cursor c = managedQuery(Uri.parse("content://com.example.umang.cr.StudentProvider/students"), null, null, null, null);
logcat:
10-04 23:31:57.777 28684-28684/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.umang.admin, PID: 28684
java.lang.SecurityException: Permission Denial: opening provider com.example.umang.cr.StudentProvider from ProcessRecord{547d1f6 28684:com.example.umang.admin/u0a97} (pid=28684, uid=10097) that is not exported from UID 10058
at android.os.Parcel.readException(Parcel.java:1943)
at android.os.Parcel.readException(Parcel.java:1889)
at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:5023)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:6131)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2546)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1909)
at android.content.ContentResolver.query(ContentResolver.java:777)
at android.content.ContentResolver.query(ContentResolver.java:712)
at android.content.ContentResolver.query(ContentResolver.java:670)
at android.app.Activity.managedQuery(Activity.java:2490)
at com.example.umang.admin.MainActivity$1.onClick(MainActivity.java:67)
at android.view.View.performClick(View.java:6303)
at android.view.View$PerformClick.run(View.java:24828)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6798)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)