Android ContactsContract Result to ListView
<p>Need help on how Im going to put the results of my code into a listview. Im having trouble following/modifying the samples from the android documentation. So I got this code from a tutorial and it does return the contacts from my phone (use a device for debugging) but it only shows it as a log in logcat.</p>

<pre><code>package com.olecontacts.sirje;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.ContactsContract.PhoneLookup;
import android.util.Log;

public class OleContactsActivity extends Activity{
    /** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        final String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
        Cursor people = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, sortOrder);
        //String[] fields = new String[] {ContactsContract.Data.DISPLAY_NAME};      
        while(people.moveToNext()){
            int nameIndex = people.getColumnIndex(PhoneLookup.DISPLAY_NAME);
            String name = people.getString(nameIndex);
            Log.d("CONTACTS", name);
        }      
    }
}
</code></pre>

<p>thanks in advance!</p>

<hr>

<p>thanks. so how should i use this vector string then? i dont know much about java to be honest.
i tried putting the results of  people.getString(nameIndex) into a string array but it wouldnt let me. it has errors and force closes my app.</p>
