Retrieve values from database and populating in listview with checkbox
===

Hi I want to retrieve values from from database and populate in a listview with checkbox. And also i want to do some process in the listview. If any of the listitem is clicked i want to show the details in text fields of selected listitem. I want to assign the ID stored in database to the checkbox.If the checkbox is clicked i want to get the value of the checkbox  to delete those items.Please help me if anybody knows.

Iam using the below code to show the details in listview:

    @Override
    	public void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.senthistory);
    		    		
    		lvhistory = (ListView) findViewById(android.R.id.list);    		
    		PopulateSentList();		
    	}
    
    	public void PopulateSentList() {
    
    		mPeopleList.clear();
    		strquery = "SELECT * FROM sent_history";
    		Cursor mCursor = (MainscreenActivity.JEEMAAndroSMSDB).rawQuery(
    				strquery, null);
    		if (mCursor.getCount() != 0) {
    			mCursor.moveToFirst();
    			do {
    				dbsentid = mCursor.getString(0);
    				dbsender=mCursor.getString(2);
    				dbmobileto = mCursor.getString(3);
    				dbmessage=mCursor.getString(4);
    				listItems.add(new Settingsmodel(dbmobileto, dbsentid));
    				ArrayAdapter<Settingsmodel> adapter = new ArrayAdapter<Settingsmodel>(
    						this,
    						android.R.layout.simple_list_item_multiple_choice,
    						listItems);
    				lvhistory.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    				adapter.notifyDataSetChanged();										
    				setListAdapter(adapter);									
    			} while (mCursor.moveToNext());
    		}
    
    		lvhistory.setOnItemClickListener(new OnItemClickListener() {
    
    			@Override
    			public void onItemClick(AdapterView<?> arg0, View arg1,
    					int position, long arg3) {
    				// TODO Auto-generated method stub
    				Settingsmodel selectedValue = (Settingsmodel) getListAdapter()
    						.getItem(position);
    				String id1 = ((Settingsmodel) selectedValue).getValue();
    				System.out.println("DATA-->>>" + id1);
    				Intent intent = new Intent(getApplicationContext(),
    						Historydisplay.class);
    				intent.putExtra("Id", id1);
    				final int result = 1;
    				startActivityForResult(intent, result);
    			}
    		});
    	}

