Code example for ListView

Methods: setItemChecked

                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) {
        public View getView(int position, View convertView, ViewGroup parent) {
            PromptListItem item = getItem(position);
            ViewHolder viewHolder = null;
            if (convertView == null) {
                int resourceId = mResourceId;
Contextual code suggestions in your IDE  Get Codota for Java