jak utworzyć niestandardową listę kontaktów z polem wyboru

jak utworzyć niestandardową listę kontaktów za pomocą pola wyboru, aby wybrać wiele kontaktów z listy w systemie Android

public class AddFromContacts extends Activity {
ArrayList<String> listname;
// ArrayList<String> list_no;
Context context;
LayoutInflater inflater;
ListView contactlistView;
String name;

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

contactlistView = (ListView) findViewById(R.id.ContactlistView);

listname = new ArrayList<String>();
// list_no = new ArrayList<String>();

ContentResolver cr = getContentResolver();
Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null,
        null, null, null);
if (cur.getCount() > 0) {
    while (cur.moveToNext()) {
        String id = cur.getString(cur
                .getColumnIndex(ContactsContract.Contacts._ID));

        String name = cur
                .getString(cur
                                    .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
        if (Integer
                .parseInt(cur.getString(cur
                        .getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {

            Cursor pCur = cr.query(
                    ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                    null,
                    ContactsContract.CommonDataKinds.Phone.CONTACT_ID
                            + " = ?", new String[] { id }, null);
            while (pCur.moveToNext()) {
                // Do something with phones
                String phoneNo = pCur
                        .getString(pCur
                                .getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));

                listname.add(name + "\n" + phoneNo);

                // list_no.add(phoneNo);

            }
            pCur.close();
        }
    }

}
contactlistView.setAdapter(new Contact(this));
}

class Contact extends BaseAdapter {
Context myContext;

public Contact(AddFromContacts contactActivity) {
    // TODO Auto-generated constructor stub
    this.myContext = contactActivity;
}

@Override
public int getCount() {
    // TODO Auto-generated method stub
    return listname.size();
}

@Override
public Object getItem(int arg0) {
    // TODO Auto-generated method stub
    return arg0;
}

@Override
public long getItemId(int arg0) {
    // TODO Auto-generated method stub
    return arg0;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    if (convertView == null) {

        inflater = (LayoutInflater) myContext
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        convertView = inflater.inflate(R.layout.checkbox, null);
        final ViewHolder viewHolder = new ViewHolder();
        viewHolder.text_name = (TextView) convertView
                .findViewById(R.id.name);
        viewHolder.id = (TextView) convertView.findViewById(R.id.id);
        viewHolder.checkBox = (CheckBox) convertView
                .findViewById(R.id.checkBox);

        convertView.setTag(viewHolder);
    }

    final ViewHolder holder = (ViewHolder) convertView.getTag();
    // holder.text_name.setText(list_no.get(position));
    holder.id.setText(listname.get(position));

    if (holder != null) {
        holder.checkBox
                .setOnCheckedChangeListener(new OnCheckedChangeListener() {

                    public void onCheckedChanged(
                            CompoundButton buttonView, boolean isChecked) {
                        // TODO Auto-generated method stub

                        // Toast.makeText(myContext, name + "     Selected",
                        // Toast.LENGTH_LONG).show();
                    }
                });
    }
    return convertView;
}
}

class ViewHolder {
TextView text_name, id;
CheckBox checkBox;
// EditText search;
}
}

ale stoję w obliczu problemu z tym, że podczas wybierania kontaktów z listy wybieram te kontakty z listy, które nie są przeze mnie wybrane

questionAnswers(1)

yourAnswerToTheQuestion