title: Use checkbox in listview and get the value of them android
body: <p>I am developing an app that get pictures from a server by j-son and show them to user in a list-view that they can choose some pic for download by check-box. </p>
  
  <p>I want to use 2 array-list:</p>
  
  <ul>
  <li>one for the pic urls </li>
  <li>another one for check-box value</li>
  </ul>
  
  <p>My problem is I don't know much about list-views. check-box of special row must change when user click on that row, and how to get the check-box value from list-view (more important).</p>
  
  <pre><code> void pics(JSONArray data){
     String url;int i;
     for (i=0;i&lt;data.length();i++){
         try {
             String u=data.getJSONObject(i).getJSONObject("images").getJSONObject("res2").getString("url");
             String t=data.getJSONObject(i).getJSONObject("images").getJSONObject("resolution1").getString("url");
             myList.add(t);
             Lists.add(u);
             url=data.getJSONObject(i).getString("type");
           if (url.equals("video"))
               continue;
      } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
     }
     try {
      if(i&lt;data.length()){
         String t=data.getJSONObject(i).getJSONObject("videos").getJSONObject("standard_resolution").getString("url");
         myList.set(i, t);}
      else{
  
  
      }
     } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  
  
  }
  </code></pre>