How do I put a method for a button in a fragment? I have a method for the button but when I click it it crashes, how do I make it work? You already have the onClick with the name of the method. Eye: I do not want to use the typical button.setOnClickList ... just the method: void button (View view) {}