I have the following scenario: a fragment that hosts a listview. In this listview the items have several buttons. Now i need to have the clicklisteners inside my fragment. How can i achieve this?
By default using android:onClick="myListener"
is searches for myListener()
in the parent activity not the fragment, which is in my opinion useless if i want to encapsulate functionality for reusability in a fragment. So i need to keep the activity out of this.
As it appears to me that onclick bindings in a list view are applied to contexts and a fragment has none on its own, i'm stuck.