title: How to get item from listView onItemClick in android?
body: <p>I'm working on an app and in that app I've created a custom listview. I am populating the listView from an API call.Now on the click of a perticular list item i want to get the data which is shown on that index.
  What shall i change in the below code</p>
  
  <pre><code>  vehicle_select_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
              ImageView selectedImage = (ImageView) view.findViewById(R.id.checkBox);
  
             selectedImage.setImageResource(R.drawable.simplecheck);
             String str =  parent.getAdapter().getItem(position).toString();
  
              Toast.makeText(getApplicationContext(), "  " + str , Toast.LENGTH_SHORT).show();
          }
      });
  }
  </code></pre>
  
  <p>Please help. Thank you</p>