Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
Created November 11, 2015 14:51
Show Gist options
  • Save WrathChaos/bc5e8bd1b9390725f02e to your computer and use it in GitHub Desktop.
Save WrathChaos/bc5e8bd1b9390725f02e to your computer and use it in GitHub Desktop.
How to getText from CustomListView's TextView by setOnClickListener
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView tv = (TextView) view.findViewById(R.id.country_name);
String country = tv.getText().toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment