Android ListView Checkbox Selection?

I think solution for you problem is using custom list adapter witch each item include contact name and contact ID, here is detail: 1) Try to create custom contact item bean include 2 properties: contactID, contactName public class contactItem{ private long contactID; private String contactName; //... } Create CustomContactAdapter: public class CustomContactAdapter extends ArrayAdapter{ ArrayList itemList = null; //Constructor public CustomContactAdapter (Context context, int MessagewResourceId, ArrayList objects, Handler handler) { //Save objects and get LayoutInflater itemList = objects; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; final ReceiveMailStruct contact= items. Get(position); if (contact! = null) { view = inflater.

Inflate(R.layout. Layout_display_contact_item, null); //Set view for contact here } } } Search custom adapter for more information 2)To handler click event at ListView you must register an handler for listitem: Step1: Register handler to List item: lvContacts. SetOnItemClickListener(new HandlerListClickEvent()) Step2: Implement proccess when item click (check/uncheck) class HandlerListClickEvent implements OnItemClickListener { public void onItemClick( AdapterView adapter, View view, int position, long id ) { //Get contact ID here base on item position } Hope it help, Regards.

I think solution for you problem is using custom list adapter witch each item include contact name and contact ID, here is detail: 1) Try to create custom contact item bean include 2 properties: contactID, contactName public class contactItem{ private long contactID; private String contactName; //... } Create CustomContactAdapter: public class CustomContactAdapter extends ArrayAdapter{ ArrayList itemList = null; //Constructor public CustomContactAdapter (Context context, int MessagewResourceId, ArrayList objects, Handler handler) { //Save objects and get LayoutInflater itemList = objects; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; final ReceiveMailStruct contact= items. Get(position); if (contact! = null) { view = inflater.

Inflate(R.layout. Layout_display_contact_item, null); //Set view for contact here } } } Search custom adapter for more information 2)To handler click event at ListView you must register an handler for listitem: Step1: Register handler to List item: lvContacts. SetOnItemClickListener(new HandlerListClickEvent()); Step2: Implement proccess when item click (check/uncheck) class HandlerListClickEvent implements OnItemClickListener { public void onItemClick( AdapterView adapter, View view, int position, long id ) { //Get contact ID here base on item position } Hope it help, Regards.

Nguyendat, that is perfect! Thank you very much for that help! :) – Skittles Nov 10 '10 at 5:09 Can you add steps how to use it please.

– pankaj Feb 1 at 12:26.

LvContacts = (ListView) findViewById(R.id. String proj_2 = new String {Data. Cursor = managedQuery(Phone.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions