Using custom adapter?
<p>I want to use custom adapter to fill my list view with phone contact data.
I have xml with 2 text views for contact name and contact number.
Also I have xml with list view and 2 buttons which I need to use latter.
I want to extend Activity if is possible not ListActivity!?
I tried lots of things(BaseAdaper, SimpleCursorAdapter ...), but every time I get an error.
I would really appreciate some help, because I don't know what to do with it.</p>

<p>this is my code:</p>

<p>public class Imenik extends ListActivity{</p>

<pre><code>TextView ime, broj;

ListView myListView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.imeniklista);

    ime = (TextView) findViewById(R.id.tvImeImenik);
    broj = (TextView) findViewById(R.id.tvSamoProba);

    Cursor contactCursor = this.managedQuery(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);

    myListView = (ListView) findViewById(R.id.lvImenik);
    this.setListAdapter(new MyContactAdaper(this, contactCursor));

}

private class MyContactAdaper extends CursorAdapter{
    private Context myContext;
    private Cursor myCursor;
    private LayoutInflater myLayoutInflater;

    public MyContactAdaper(Context context, Cursor cursor) {
        super(context, cursor, true);
        // TODO Auto-generated constructor stub
        myLayoutInflater = LayoutInflater.from(context);
        myContext = context;
    }

    @Override
    public void bindView(View view, Context context, Cursor cursor) {
        // TODO Auto-generated method stub
        ime.setText(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
        broj.setText(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)));
    }

    @Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        // TODO Auto-generated method stub
        final View view = myLayoutInflater.inflate(R.layout.imenik, parent, false);
        return view;
    }

}
</code></pre>
