Code example for ListView

Methods: setItemChecked

0
                ct = (CheckedTextView) viewHolder.textView;
                // Apparently just using ct.setChecked(true) doesn't work, so this 
                // is stolen from the android source code as a way to set the checked 
                // state of these items 
                if (listView != null) {
                    listView.setItemChecked(position, mSelected[position]);
                } 
            } catch (Exception e) {
                return; 
            } 
 
        } 
 
        @Override 
        public View getView(int position, View convertView, ViewGroup parent) {
            PromptListItem item = getItem(position);
            ViewHolder viewHolder = null;
 
            if (convertView == null) {
                int resourceId = mResourceId;
                if (item.isGroup) {