I have a custom listadapter with an image and text at each level. I want to get the text of the selected level.
public View updateView(View view, TreeNodeInfo<Long> treeNodeInfo) {
final LinearLayout viewLayout = (LinearLayout) view;
final TextView descriptionView = (TextView) viewLayout.findViewById(R.id.item);
final ImageView img = (ImageView)viewLayout.findViewById(R.id.image);
return viewLayout; }
In my activity class i have a clicklistener on the list.
customlist.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id){
//dostuff
}
});
(TextView)view.findViewById(R.id.item);
returns only the text for the first item only and not any other selected item on the list.
How do i get the text of the selected item.??
.
Use the underlying data used to bind the text to the text view, update that data, and notify the ListView that the data changed.