Deleting from listview database in fragments Android Studio

Hi ! (kinda new here) I followed a tutorial from this site …But my question is how do i delete the items from the list view (I use fragments ) and i also get this error :slight_smile:

 Process: com.example.pethealth, PID: 26830
    java.lang.IllegalStateException: Could not find method deleteTask(View) in a parent or ancestor Context for android:onClick attribute defined on view class with id 'task_delete'
        at android.view.View$DeclaredOnClickListener.resolveMethod(
        at android.view.View$DeclaredOnClickListener.onClick(
        at android.view.View.performClick(
        at android.view.View$
        at android.os.Handler.handleCallback(
        at android.os.Handler.dispatchMessage(
        at android.os.Looper.loop(
        at java.lang.reflect.Method.invoke(Native Method)

Thank you in advance :slight_smile:

Hello there @andradobritoiu97

A rather late reply. Does this article on SO help?