title: ArrayAdapter is changing the value of the CheckBox
body: <p>I don't know what's happening, I've a list of objects and depending of its state it's checked or not (<code>CheckBox</code>).
  I've tried too many ways, because first of all I wanted to return an <code>ArrayList&lt;myObject&gt;</code> with the state updated, but I don't know why the objects were duplicating... and I ended up creating a <code>TreeSet</code> (don't know if it's the better way but at least the objects now doesn't repeat)... well the thing is that on my <code>Adapter</code> I have this : </p>
  
  <pre><code>final Sessio sessio = getItem(position);
      ALAdapter.add(sessio);
      vh.tvSessioName.setText(sessio.getName());
      vh.cbAssist.setChecked(sessio.isState());
      vh.cbAssist.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              Toast.makeText(mContext, "chaning", Toast.LENGTH_SHORT).show();
              sessio.setState(isChecked);
          }
      });
  </code></pre>
  
  <p>AlAdapter is <code>private TreeSet&lt;Sessio&gt; ALAdapter;</code></p>
  
  <p>this is working fine, the problem is at the time I re-open the dialog because I save the <code>TreeSet</code> on a <code>json</code> with <code>Gson</code> as follows :</p>
  
  <pre><code>Gson gson = new Gson();
  String json = mPrefs.getString("ArrayListSesio", "");
  Type type = new TypeToken &lt;TreeSet&lt;Sessio&gt;&gt; () {}.getType();
  ArrayList&lt;Sessio&gt; obj = gson.fromJson(json,type);
  return obj == null ? AlSessio : obj;
  </code></pre>
  
  <p>This is also working fine... I think the problem is on the <code>Adapter</code> because if I uncked some of the <code>CheckBox</code> and I change the state of the <code>Sessio</code> when I re-open the <code>Dialog</code> it shows the <code>Toast</code> like 15 times... and everytime I scroll up/down the state of the <code>CheckBox</code> changes....</p>
  
  <p>What I'm doing wrong? Is there any other way to instead of save it to a <code>TreeSet</code> save it to an <code>ArrayList</code>?</p>