Permission denial to read from emailprovider in android

Posted by Ambika on Stack Overflow See other posts from Stack Overflow or by Ambika
Published on 2010-03-31T12:11:50Z Indexed on 2010/03/31 12:13 UTC
Read the original article Hit count: 509

Hello Everyone,

I've the problem when I want to read "com.android.email.provider" to get email accounts.

Here is my code to retrieve the account :

Cursor c = null; Uri CONTENT_URI = Uri.parse("content://com.android.email.provider/account"); String RECORD_ID = "_id"; String[] ID_PROJECTION = new String[] {RECORD_ID };
c = getContentResolver().query(CONTENT_URI,ID_PROJECTION,null, null, null);

I get a security exception:

java.lang.SecurityException: Permission Denial: reading com.android.email.provider.EmailProvider uri content://com.android.email.provider/account from pid=278, uid=10003 requires com.android.email.permission.ACCESS_PROVIDER

I want to know the account is created or not in some other app. Is there any other way to resolve this so that I can read from the provider.

I have also tried by adding the permission in manifest:

That dint not help.

Any solution would be greatly appreciated.

Thanks in advance

© Stack Overflow or respective owner

Related posts about android-manifest

Related posts about android