title: Call a method continuously when button is in pressed state
body: <p>I am trying to call a method continuously as long as button is pressed.</p>
  
  <pre><code>public void onClick(View view) {
  method();
  }
  
  
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Button xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/button_send"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="@string/button_send"
  android:onClick="onClick" /&gt;
  </code></pre>