title: How to get checked event of Listview in ListFragment
body: <p>I have a JSONArray which adds data to <code>list = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();</code></p>
  
  <p>The list display is working fine. Data is received and displayed perfectly.</p>
  
  <p>But when I add a checkbox for it, the checkbox wont work. I checked some tutorials all have used ListFragment but its not working in mine.</p>
  
  <p>code: </p>
  
  <pre><code>    @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container,
                  Bundle savedInstanceState) {
  
              rootView = inflater.inflate(R.layout.fragment_list, container, false);
  
              // Hashmap for ListView
              list = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
              listview = (ListView) rootView.findViewById( R.id.list );  
  
              // When item is tapped, toggle checked properties of CheckBox and Planet.  
              listview .setOnItemClickListener(new AdapterView.OnItemClickListener() {  
                @Override  
                public void onItemClick( AdapterView&lt;?&gt; parent, View item,   
                                         int position, long id) {  
                  .......
                }  
              });  
  
  
              return rootView;
  
          }
  
          class LoadMatches extends AsyncTask&lt;String, String, String&gt; {
              @Override
              protected void onPreExecute() {
                  super.onPreExecute();
                  pDialog = new ProgressDialog(getActivity());
                  pDialog.setMessage("Loading Matches..");
                  pDialog.setIndeterminate(false);
                  pDialog.setCancelable(false);
                  pDialog.show();
              }
  
              @Override
              protected String doInBackground(String... arg0) {
                  new ArrayList&lt;NameValuePair&gt;();
                  new DefaultHttpClient(new BasicHttpParams());
                  DefaultHttpClient defaultClient = new DefaultHttpClient();
                              // Setup the get request
                  HttpGet httpGetRequest = new HttpGet(URL_MATCHES);
                              try{
                                  // Execute the request in the client
                                  HttpResponse httpResponse = defaultClient.execute(httpGetRequest);
                                  // Grab the response
                                  BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), "UTF-8"));
                                  json = reader.readLine();                       
                                  }catch(Exception e){
                                      Log.d("Error in JSON",e.toString());
                                  }
  
                  try {               
                      istArray= new JSONArray(json);
  
                      if (matches != null) {
                          // looping through All albums
                          for (int i = 0; i &lt; listArray.length(); i++) {
                              JSONObject c = istArray.getJSONObject(i);
  
                              // Storing each json item values in variable
                              id = c.getString(TAG_ID);
                              schname = c.getString(TAG_SCHNAME);
                          place= c.getString(TAG_PLACE);
                              datetime = c.getString(TAG_DATETIME);
  
                             // creating new HashMap
                              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                              // adding each child node to HashMap key =&gt; value
                              map.put(TAG_ID, id);
                              map.put(TAG_SCHNAME, schname);
                              map.put(TAG_PLACE, place);
                              map.put(TAG_DATETIME, datetime);
  
  
  
                              // adding HashList to ArrayList
                              list.add(map);
                          }
                      }else{
  
  
                          Log.d("Matches: ", "null");
                      }
  
                  } catch (JSONException e) {
  
                      e.printStackTrace();
                  }
  
                  return null;
              }
              @Override
              protected void onPostExecute(String file_url) {
                  // dismiss the dialog after getting all albums
                  pDialog.dismiss();
                  // updating UI from Background Thread
                  getActivity().runOnUiThread(new Runnable() {
                      @Override
                      public void run() {
                          /**
                           * Updating parsed JSON data into ListView
                           * */
  
                           ListAdapter adapter = new SimpleAdapter(
                                  getActivity(), list
                                  R.layout.s_list, new String[] { TAG_ID,
                                      TAG_SCHNAME, TAG_PLACE, TAG_DATETIME, }, new int[] {
                                          R.id.list_id, R.id.schname, R.id.place, R.id.datetime });
                          // updating listview
                          list.setAdapter(adapter);
                      }
                  });
  
              }
          }    
    }  
  </code></pre>
  
  <p>The list layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/bg"&gt;
  
  
  &lt;ListView
      android:id="@+id/list"
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:layout_alignParentTop="true"
      android:layout_marginTop="40dp"
      android:layout_marginLeft="10dp"
      android:layout_marginRight="10dp"
      android:background="@color/white_overlay_list"
      android:divider="@color/lists_divider"
      android:dividerHeight="1dp"
      android:paddingLeft="5dp"
      android:paddingRight="5dp"
      android:paddingTop="0dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Single list layout </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"&gt;
  
      &lt;!-- Album id / Hidden by default --&gt;
      &lt;TextView
          android:id="@+id/list_id"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:visibility="gone" /&gt;
  
      &lt;TextView
          android:id="@+id/schname"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          ndroid:layout_marginLeft="20dp"
          android:layout_marginTop="35dp"
          android:gravity="left"
         android:textColor="@color/black_font_color"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  
      &lt;TextView
          android:id="@+id/datetime"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
  
          android:layout_marginTop="10dp"
          android:textColor="@color/black_font_color"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TextView
          android:id="@place
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/datetime"
          android:layout_below="@+id/datetime"
          android:layout_marginTop="5dp"
          android:layout_marginBottom="15dp"
  
          android:textColor="@color/black_font_color"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
       &lt;CheckBox
          android:id="@+id/checkBox"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"
          android:text="CheckBox" /&gt;      
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>