title: Need help in using scene2d button in libgdx
body: <p>I am new to libGDX. I am trying to create a custom button by extending com.badlogic.gdx.scenes.scene2d.ui.Button.</p>
  
  <p>I want all the button related logic in this class. But I am not getting how to make the click work. I read many tutorials regarding adding Event Listeners but nothing is working.</p>
  
  <pre><code>public class RestartButton extends Button {
  
  public RestartButton(ButtonStyle style) {
      super(style);
  
  }
  
  @Override
  public void draw(SpriteBatch batch, float parentAlpha) {
      batch.draw(TextureProvider.getInstance().getRestart(), 175, 100);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And i am trying to add my button in the screen(i.e in show method) like this</p>
  
  <pre><code>RestartButton restartButton;
  restartButton=new RestartButton(new ButtonStyle());
  Stage stage;
  stage.addActor(restartButton);
  </code></pre>
  
  <p>I am able to see my button on the screen. Now what i want to do is add some code which gets invoked when button is clicked or touched. Can someone please help ?</p>