views:

478

answers:

3

Hello, All I am trying to do is read a contact off of my emulator and display it to the screen. I can't seem to resolve this error. Both of my packages (com.msi.ibm.tutorial and .MobileServiceCallContacts) have the permission READ_CONTACTS set in their manifest xml files.

So any ideas as to what I've got wrong ?

Here is the error message from eclipse console if it helps, it's not helping me, but I'm a little rusty at this and completely new to Android development.

MobileServiceCallContacts]Starting activity com.msi.ibm.tutorial.MobileServiceCallContacts on device 
MobileServiceCallContacts]ActivityManager: Starting: Intent { cmp=com.msi.ibm.tutorial/.MobileServiceCallContacts }
MobileServiceCallContacts]ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.msi.ibm.tutorial/.MobileServiceCallContacts } from null (pid=-1, uid=-1) requires android.permission.READ_CONTACTS
+2  A: 

Once i had this problem, I solved it by adding the permission declaration to the activity itself

<activity  
android:permission="android.permission.READ_CONTACTS"  
... />
Arcantos
I tried that and did not seem to help me. I added it in all kinds of places to no avail...
jkmcgee
+1  A: 

I added the following line of code:

to just before the end manifest tag.

Removed any other code that mentioned this permission, stopped getting this error.

jkmcgee
I don't know why my line of code is not showing up:"<uses-permission android:name="android.permission.READ_CONTACTS"/>"
jkmcgee
A: 

I had exactly the same problem, and the described solution works!

Thank you very much für sharing.

Paul

PaulF