Code example for SparseBooleanArray

Methods: size

0
             
            notifyDataSetChanged();
        } 
         
        public int getSelectedCount() { 
            return mSelectedItemsIds.size();// mSelectedCount;
        } 
         
        public SparseBooleanArray getSelectedIds() {
        	return mSelectedItemsIds;
        } 
         
        @Override 
        public View getView(int position, View convertView, ViewGroup parent) {
        	 
        	if(convertView == null){
        		LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
        		convertView = inflater.inflate(android.R.layout.simple_list_item_1, null);
        	}         	 
        	((TextView) convertView).setText(getItem(position));    
        	//change background color if list item is selected