title: binding adapter to list view
body: <pre><code>if(cur.moveToFirst())
          {
          do{
              int nameidx=cur.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME);
              int Ididx=cur.getColumnIndexOrThrow(ContactsContract.Contacts.HAS_PHONE_NUMBER);
              String strName=cur.getString(nameidx);
              String strId=cur.getString(Ididx);
              if(strId.equals("0")) continue;
              Toast.makeText(this,"Contact Name: "+strName, Toast.LENGTH_LONG).show();
              names.add(strName);
              //result[cur.getPosition()]=strName+"("+strId+")";
          }while(cur.moveToNext());
          adapter=new ArrayAdapter&lt;String&gt;(this, R.layout.list_view_item, names);
          setListAdapter(adapter);
  </code></pre>
  
  <p>this my code and i am getting error at setListAdapter(adapter) as setListAdapter is undefined. please help me in resolving this error.</p>