I would like to get all the contact list(content provider) and append them into a TextView
<p>I wonder if i am in the right path. The emulator keeps showing the message xxx.app stopped exectedly and ask to force shutdown.
Here are the codes</p>

<pre><code>package fypj.ContactList;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.Contacts.People;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;

public class ContactList extends Activity {
    ListView ContactsLV;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


        ContactsLV = (ListView)findViewById(R.id.ContactsLV);

        populateContactList();
    }
    public void contentProvider(ContentResolver getContentResolver){
        ContentValues values = new ContentValues();
        values.put(Phone.DISPLAY_NAME, "Jaslyn");   
        values.put(Phone.LABEL, "Jaslyn Goh");
        values.put(Phone.STARRED, 1);
        Uri uri = getContentResolver().insert(Phone.CONTENT_URI, values);

        Uri phoneUri = null;
        Uri emailUri = null;
        phoneUri = Uri.withAppendedPath(uri, People.ContactMethods.CONTENT_DIRECTORY);

        values.clear();
        values.put(Phone.TYPE, Phone.TYPE_MOBILE);
        values.put(Phone.NUMBER, "91289161");
        getContentResolver().insert(phoneUri, values);
        emailUri = Uri.withAppendedPath(uri, People.ContactMethods.CONTENT_DIRECTORY );
        values.clear();
        //values.put(People.ContactMethods.KIND, Contacts.KIND_EMAIL);
        values.put(People.ContactMethods.DATA, "asd@hotmail.com");
        values.put(People.ContactMethods.TYPE, People.ContactMethods.TYPE_HOME);
        getContentResolver().insert(emailUri, values); 

    }
    public void populateContactList(){


        Cursor c = getContacts();
        String[] contacts = new String[]{
                ContactsContract.Data.DISPLAY_NAME,
                //ContactsContract.Data.CONTACT_STATUS,
                //ContactsContract.Contacts.STARRED,
                };
        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.main,
                c, contacts, new int[] {R.id.ContactsLV});
        //ContactsLV.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, contacts));
        ContactsLV.setAdapter(adapter);

    }
    private Cursor getContacts(){
        Uri uri = ContactsContract.Contacts.CONTENT_URI;
        String[] projection = new String[] {
        //ContactsContract.Contacts._ID,
        ContactsContract.Contacts.DISPLAY_NAME,
        };
        String[] selectionArgs = null;
        String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
        //String selection = null;
        String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'";
        return managedQuery(uri, projection,selection,selectionArgs, sortOrder);
    }
}
</code></pre>

<p>Logcat</p>

<pre><code>03-21 08:32:54.013: ERROR/InputDispatcher(64): Received spurious receive callback for unknown input channel.  fd=167, events=0x8
03-21 08:32:54.013: ERROR/InputDispatcher(64): Received spurious receive callback for unknown input channel.  fd=170, events=0x8
03-21 08:32:54.013: ERROR/InputDispatcher(64): Received spurious receive callback for unknown input channel.  fd=178, events=0x8
03-21 08:32:54.023: ERROR/InputDispatcher(64): Received spurious receive callback for unknown input channel.  fd=188, events=0x8
03-21 08:33:03.053: ERROR/TelephonyManager(64): Hidden constructor called more than once per process!
03-21 08:33:03.053: ERROR/TelephonyManager(64): Original: android, new: android
03-21 08:33:45.002: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.002: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.002: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.002: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.002: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.011: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.011: ERROR/libEGL(64): called unimplemented OpenGL ES API
03-21 08:33:45.021: ERROR/libEGL(64): called unimplemented OpenGL ES API
</code></pre>
