checkboxes with list view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

checkboxes with list view

Postby gsk » Tue Nov 11, 2008 6:24 am

Hi ...
Iam developing an application , in which I used check boxes with a list view in a ListActivity.

In that listview , user has to check the items and he can do delete or update the items .
But when i check on that items i couldn't able to get the item id,which i was checked .

below code i was written ...

public class MyList extends ListActivity {

public static final String TAG="listofitems";

private String[] mStrings = {"Bleu de Septmoncel",
"Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore"};

List<String> list=Arrays.asList(mStrings);

public void onCreate(Bundle savedInstanceState)

setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,list));
// ListView lv= getListView().setTextFilterEnabled(true);

// Inform the list we provide context menus for items

final ListView listView = getListView();



Please help me to delete or edit items which i was checked in the list.
Junior Developer
Junior Developer
Posts: 10
Joined: Wed Nov 05, 2008 11:12 am


Postby MrSnowflake » Tue Nov 11, 2008 11:14 am

Create you own ListAdapter for the listview
User avatar
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby gsk » Wed Nov 12, 2008 7:16 am

I created the list adapter ..
but iam not getting the items which i checked in the view.
Junior Developer
Junior Developer
Posts: 10
Joined: Wed Nov 05, 2008 11:12 am

Postby desuvinodkumar » Tue Aug 11, 2009 7:50 am


Change ur adapter like this ....

ListAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_multiple_choice, // Use a template
// that displays a
// text view
c, // Give the cursor to the list adatper
new String[] {People.NAME}, // Map the NAME column in the
// people database to...
new int[] {});
User avatar
Senior Developer
Senior Developer
Posts: 102
Joined: Mon Mar 23, 2009 6:51 am
Location: India


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests