title: How to create a listview where we can swipe to select the item?
body: <p>I have created this list view to select the students who are attending a particular class by simply clicking on the items.
  But i want to select the items by swiping the items from left to right. How could i do so?
  <img src="https://i.stack.imgur.com/ubxCu.jpg" alt="Attendance"></p>
  
  <p>Here's the code inside <strong>Attendance activity.java</strong></p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {    
  try {
  
                  setListAdapter(new ArrayAdapter&lt;String&gt;(this,
                          android.R.layout.simple_list_item_checked, new ArrayList()));
                  ListView listView = getListView();
                  listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  
                  new AddStringTask().execute();
              } catch (Exception e) {
                  Toast.makeText(getApplicationContext(), "Null", Toast.LENGTH_LONG)
                          .show();
              }
  </code></pre>