setOnItemClickListener on custom ListView


Question

I have a custom ListView. This ListView contains 1 Image and 6 TextViews. To retrieve the value I have created a setOnItemClickListener(...). Whenever I click on the ListView how could I actually retrieve all the data from the 6 TextViews?

1
24
8/2/2016 12:42:44 PM

Sample Code:

ListView list = (ListView) findViewById(R.id.listview);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
   @Override
   public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
      Object listItem = list.getItemAtPosition(position);
   } 
});

In the sample code above, the listItem should contain the selected data for the textView.

58
1/27/2017 10:02:20 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon