Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Multi Select ListView

Multi Select ListView

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

Multi Select ListView

Postby sunflower » Wed May 27, 2009 2:41 am

HI,

I want to create multi select listview with checkbox. and also make checked = true for some of the item based on some business rule.

I can get the list view with multiple choice option working but I am not able to load some of the item as default checked when list view first loaded.

I tried using custom list adpater with following code, but its not working at all.

if (convertView == null) {
convertView = mInflater.inflate(android.R.layout.simple_list_item_multiple_choice, null);

holder = new ViewHolder();
holder.checkbox = (CheckedTextView) convertView.findViewById(android.R.id.text1);

convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
//holder.checkbox.setChecked(true);
String mvalue = ((Item)lv.get(position)).getValue();
holder.checkbox.setText(mvalue);
if(mSelectedValues != null && mSelectedValues.length > 0) {
boolean blnSetChecked = false;
for(String s : mSelectedValues) {
if(s.equalsIgnoreCase(mvalue)) {
blnSetChecked = true;
break;
}
}
holder.checkbox.setChecked(blnSetChecked);
} else
holder.checkbox.setChecked(false);

return convertView;


I have also set follwoign property for listview after setting custom adapter.

lvList.setItemsCanFocus(false);
lvList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

Please help me to get this working.

Thanks in Advance.
Sunflower.
sunflower
Junior Developer
Junior Developer
 
Posts: 13
Joined: Wed Mar 04, 2009 3:38 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests