title: java.lang.SecurityException trying to read from Android Contacts URI
body: <p>I am trying to read Contact names, phone #'s, and emails from the <code>ContactsContract</code> URI, and I am getting a <code>SecurityException</code> when I try to run the program.  I have set the permission in the <code>AndroidManifest.xml</code> file:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="edu.smumn.cs394"
        android:versionCode="1"
        android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="8" /&gt;
      **&lt;uses-permission android:name="android.pemission.READ_CONTACTS"/&gt;**
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
          &lt;activity android:name=".ReadPhoneNumbers"
                    android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;`
  </code></pre>
  
  <p>The following is the application code:</p>
  
  <pre><code> @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.contact_list);       
          ContentResolver resolver = getContentResolver();
          Cursor c = resolver.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
   //[...] Work through data here`
  </code></pre>
  
  <p>I get a security exception on the last line (<code>resolver.query()</code>):</p>
  
  <pre><code>`03-08 07:41:40.812: ERROR/AndroidRuntime(416): FATAL EXCEPTION: main
  03-08 07:41:40.812: ERROR/AndroidRuntime(416): java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.smumn.cs394/edu.smumn.cs394.ReadPhoneNumbers}: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts from pid=416, uid=10037 requires android.permission.READ_CONTACTS
  [...]
  03-08 07:41:40.812: ERROR/AndroidRuntime(416): Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts from pid=416, uid=10037 requires android.permission.READ_CONTACTS
  [...]
  03-08 07:41:40.812: ERROR/AndroidRuntime(416):     at edu.smumn.cs394.ReadPhoneNumbers.onCreate(ReadPhoneNumbers.java:30)
  </code></pre>
  
  <p>[...]`</p>
  
  <p>I must be missing something, but I can't figure out what.</p>