I have a listview with some items. I would like to get the text from the selected item.
Here is my list adapter and the onItemClickListener:
ListView
I found a simplest way:
list_content.xml
android:id="@+id/content" android:onClick="get_content" />
MainActivity
public void get_content(View view){ TextView textView = view.findViewById(R.id.content); System.out.println("Text is: "+textView.getText().toString()); }