title: How to get Android phone contacts in list view programmatically this my code
body: <pre><code>ContentResolver cr = getContentResolver();
  Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null);
  
  View view=View.inflate(context, R.layout.main, null);
  ListView list = (ListView)view. findViewById(android.R.id.list);
  String[] columns = new String[{ContactsContract.Contacts.DISPLAY_NAME,ContactsContract.PhoneLookup.NUMBER};
  
  int[] views = new int[] {R.id.contactName, R.id.contactID};
  SimpleCursorAdapter adapter = new SimpleCursorAdapter(context,R.layout.text,cur,columns, views);
  
  list.setAdapter(adapter);   
  </code></pre>