Note that there are some explanatory texts on larger screens.

plurals
  1. POOrder of installing the application is changing the behaviour?
    text
    copied!<p>I have three applications: University, Student, Staff. </p> <p>University is the Main application. Student and Staff are provider application.</p> <p>University is having the permission to access the info from this provider applications.</p> <p>I installed the apk in following order <strong>student, staff and University</strong>. this is working fine</p> <p>But if i install in the order <strong>University, student and staff</strong>. </p> <p>In this case University is crashed and the error is "access permission is denied".</p> <p>Why this is happening even if we have proper permission? Why the provider installed later is not accessible by main application?</p> <pre><code> 01-29 16:49:48.257: E/AndroidRuntime(2622): Caused by: java.lang.SecurityException: Permission Denial: opening provider com.content.StudentProvider from ProcessRecord{b4849ad0 2622:com.example.University/u0a44} (pid=2622, uid=10044) requires com.content.READ or com.content.WRITE 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.os.Parcel.readException(Parcel.java:1425) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.os.Parcel.readException(Parcel.java:1379) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2354) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.app.ActivityThread.acquireProvider(ActivityThread.java:4219) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:1703) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1099) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.content.ContentResolver.query(ContentResolver.java:354) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.content.CursorLoader.loadInBackground(CursorLoader.java:65) 01-29 16:49:48.257: E/AndroidRuntime(2622): at android.content.CursorLoader.loadInBackground(CursorLoader.java:43) </code></pre> <p>Provider - Student - Manifest</p> <pre><code> &lt;permission android:description="@string/readPermissionDescription" android:name="com.content.student.READ" android:protectionLevel="normal"&gt;&lt;/permission&gt; &lt;permission android:description="@string/writePermissionDescription" android:name="com.content.student.WRITE" android:protectionLevel="dangerous"&gt;&lt;/permission&gt; &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;provider android:name=".StudentProvider" android:authorities="com.content.student" android:readPermission="com.content.student.READ" android:writePermission="com.content.student.WRITE" &gt; &lt;/provider&gt; &lt;/application&gt; </code></pre> <p>University - Manifest</p> <pre><code> &lt;uses-permission android:name="com.content.student.READ" /&gt; &lt;uses-permission android:name="com.content.student.WRITE" /&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload