title: How can I create a BindingConverter that allows me to drop the View parameter of a click listener on Android?
body: <p>I've got a lot of methods with this signature:</p>
  <pre><code>public void onButtonClick(View view) {
   
  }
  </code></pre>
  <p>Most of the time I don't need the <code>view</code> parameter, and AS gives me an unused method property warning.</p>
  <p><em>Desired solution</em>: A <code>@BindingConverter</code> for Android Databinding that translates a function with no parameters to a <code>View.ClickListener</code>.</p>
  <p>I've tried this but it fails compile-time stating it doesn't match the method signature. Why?</p>
  <pre><code>public interface MyAction {
      void act();
  }
  
  @BindingConversion
  public static View.OnClickListener convertaroony(final MyAction action) {
      return new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              action.act();
          }
      };
  }
    
  &lt;Button
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:text=&quot;Clicky&quot;
          android:onClick=&quot;@{activity::onButtonClick}&quot;/&gt;
  
  public class JavaActivity extends AppCompatActivity {
      public void onButtonClick() {
          Log.i(&quot;JAVA&quot;, &quot;I got a click, sir!&quot;);
     }
  }
  </code></pre>