title: Why is my OnClick Method on the Button not working?
body: <p>I am trying to call Methods via DataBinding from the ViewModel. I have tried changing the code inside the layout file for onClick, but nothing works. It shows this error:</p>
  
  <p>Listener class android.view.View.OnClickListener with method onClick did not match signature of any method model::click</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout&gt;
  
      &lt;data&gt;
          &lt;variable
              name="model"
              type="com.example.myapplication.MainActivityViewModel" /&gt;
      &lt;/data&gt;
  
      &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".MainActivity"&gt;
  
          &lt;TextView
              android:text="Hey I am a Text View"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerInParent="true"/&gt;
  
          &lt;Button
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="true"
              android:text="Press Me"
              android:onClick="@{model::click}"/&gt;
  
      &lt;/RelativeLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <pre><code>package com.example.myapplication;
  
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.databinding.DataBindingUtil;
  import androidx.lifecycle.ViewModelProviders;
  
  import android.os.Bundle;
  
  import com.example.myapplication.databinding.ActivityMainBinding;
  
  public class MainActivity extends AppCompatActivity {
  
      ActivityMainBinding binding;
      MainActivityViewModel viewModel;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          binding = DataBindingUtil.setContentView(this,R.layout.activity_main);
          viewModel = ViewModelProviders.of(this).get(MainActivityViewModel.class);
          binding.setModel(viewModel);
      }
  }
  </code></pre>
  
  <pre><code>package com.example.myapplication;
  
  import android.util.Log;
  
  import androidx.lifecycle.MutableLiveData;
  import androidx.lifecycle.ViewModel;
  
  import static android.content.ContentValues.TAG;
  
  public class MainActivityViewModel extends ViewModel {
  
      public void click(){
          Log.d(TAG, "click: This Button got Clicked");
      }
  }
  </code></pre>
  
  <p>I want a Log Message, when the Button is clicked</p>