Deleting from listview database in fragments Android Studio

Hi ! (kinda new here) I followed a tutorial from this site https://www.sitepoint.com/starting-android-development-creating-todo-app/ …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 android.support.v7.widget.AppCompatButton with id 'task_delete'
        at android.view.View$DeclaredOnClickListener.resolveMethod(View.java:5400)
        at android.view.View$DeclaredOnClickListener.onClick(View.java:5359)
        at android.view.View.performClick(View.java:6291)
        at android.view.View$PerformClick.run(View.java:24931)
        at android.os.Handler.handleCallback(Handler.java:808)
        at android.os.Handler.dispatchMessage(Handler.java:101)
        at android.os.Looper.loop(Looper.java:166)
        at android.app.ActivityThread.main(ActivityThread.java:7529)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) 

Thank you in advance :slight_smile: