checkbox in listview in android
<p>In my code the assigned value comes through the server when assigned value is 1.
The <code>checkbox</code> value in <code>listview</code> should be <code>checked</code> while <code>unchecked</code> ...
and after load of listview if I try to check on already checked or change that state it shows an alert box  </p>

<p>When I check rest of <code>checkbox</code> while scrolling its automatically unchecked..</p>

<pre><code>boolean checked[];
ArrayList&lt;HashMap&lt;String, Object&gt;&gt; Arraymanagemember = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();
ListView managelist = (ListView) findViewById(R.id.managememberlist);
final CheckBox cbox = (CheckBox) managelist.findViewById(R.id.usercheck);
for (int i = 0; i &lt; array.length(); i++) {
  HashMap&lt;String, Object&gt; membermap = new HashMap&lt;String, Object&gt;();
  memberinfo[i] = array.getJSONObject(i).getString("username").toString();
  assingedinf[i] = array.getJSONObject(i).getString("assigned").toString();
  if (assingedinf[i].equals("1")) {
    membermap.put("assign", true);
  } else {
    membermap.put("assign", isTaskRoot());
  }
  membermap.put("member", memberinfo[i]);

  Arraymanagemember.add(i, membermap);
}

SimpleAdapter memberadp = new SimpleAdapter(
  getApplicationContext(), 
  Arraymanagemember,
  R.layout.managememberrow, 
  new String[]{"member", "assign"}, new int[]{R.id.manageuserinfo, R.id.usercheck}
);
managelist.setAdapter(memberadp);
managelist.setOnItemClickListener(new OnItemClickListener() {
  @Override
  public void onItemClick(
    AdapterView&lt;?&gt; parent,
    View arg1, int postion,
    long arg3) {
      if (assingedinf[postion].equals("1")) {
        Toast.makeText(getApplicationContext(), "not run", Toast.LENGTH_SHORT).show();
      }
    }
  }
});
</code></pre>
