title: Android Listview & Checkbox Issue
body: <p>I am attempting to check my checkbox every time the listview item is clicked. I can't seem to get it to work. I've cut down the code to what I believe is causing my problem:</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>@Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      //What I am trying which does not seem to work
      if(checkBox.isChecked()){
          fld.setToSelected(false);
          Toast.makeText(getApplicationContext(), "Unchecked", Toast.LENGTH_SHORT).show();
  
      }else{
          fld.setToSelected(true);
          Toast.makeText(getApplicationContext(), "Checked", Toast.LENGTH_SHORT).show();
  
      }
  
      handler.removeCallbacks(runnable);
  
      super.onListItemClick(l, v, position, id);
  
      AutoCompleteTextView auto = (AutoCompleteTextView) findViewById(R.id.editTextComplete);
      auto.setText("");
  
      selectedFriend.add(names.get(position));
      names.get(position);
  
  }
  </code></pre>
  
  <p>FriendListData.java</p>
  
  <pre><code>boolean selected = false;
  
  public boolean isSelected() {
      return selected;
  }
  
  public void setToSelected(boolean selected) {
      this.selected = selected;
  }
  </code></pre>
  
  <p>FriendBaseAdapter.java</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
      MyViewHolder mViewHolder;
  
      if(convertView == null) {
          convertView = inflater.inflate(R.layout.friend_item, null);
          mViewHolder = new MyViewHolder();
          convertView.setTag(mViewHolder);
      } else {
          mViewHolder = (MyViewHolder) convertView.getTag();
      }
  
      mViewHolder.friendName = detail(convertView, R.id.friendName, myList.get(position).getFriend());
      mViewHolder.checkedName = detail(convertView, R.id.checkedFriend, myList.get(position).isSelected());
  
      return convertView;
  }
  
  
  private CheckBox detail(View v, int resId, boolean isChecked){
      CheckBox checkBox = (CheckBox)v.findViewById(resId);
      checkBox.setChecked(isChecked);
      return checkBox;
  
  }
  </code></pre>
  
  <p>friend_item.xml</p>
  
  <pre><code>&lt;CheckBox
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/checkedFriend"
      android:layout_alignParentTop="true"
      android:layout_alignParentRight="true"
      android:layout_alignParentEnd="true"
      android:checked="false"
      android:focusable="false"
      android:clickable="false"/&gt;
  </code></pre>
  
  <p>All help is appreciated. If more code is needed, please ask.</p>