checkboxes with list view

Put your problem here if it does not fit any of the other categories.

checkboxes with list view

Postby gsk » Thu Nov 13, 2008 6:41 am

hello..

Iam very new to android ...

Iam developing a sample application which needs checkboxes with a listview (I mean I want to display the listview with a checkbox which attached to item in listview)

I did it in normal way like ..... taking a class which extends listactivity. And Overriding the Oncreate();
setting the list adapter.

setListAdapter(new ArrayAdapter<String>this,android.R.layout.simple_list_item_multiple_choice,arraylistitems));


and I am showing the list by following c ode:


final ListView listView = getListView();

listView.setFocusable(false);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

finally

Iam gettng the listview with checkboxes..

And toget the status of checked item : Iam using the following code ..

GetListView().isItemChecked();

and its working fine for me....

but I didnt understand the suggetions which given in this forum to get the checkbox functionality.
I mean .. should I develop the code as u people suggested..


please tel me ... if anything goes wrong with my code in the future purpose...
gsk
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Nov 05, 2008 11:12 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 10 guests