views:

588

answers:

1

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

+1  A: 

In your AndroidManifest.xml you have to put

<uses-permission android:name="com.android.email.permission.ACCESS_PROVIDER" />
BrennaSoft
This, and the OP's request, are not supported by the SDK.
CommonsWare

related questions