title: onClick not working in mvvm in android databinding
body: <p>I am trying to implement mvvm and databinding in kotlin first time. I followed some tutorial and able to implement same. But now button click is not working which I have written in mvvm.   </p>
  
  <p>Here is activity_login.xml    </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  &lt;data&gt;
      &lt;variable
              name="viewmodel"
              type="com.abc.abc.presentation.user.viewmodels.LoginViewModel"/&gt;
  &lt;/data&gt;
  &lt;RelativeLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".presentation.user.views.LoginActivity"
          android:layout_margin="24dip"&gt;
      &lt;Button
              android:layout_width="match_parent"
              android:layout_height="40dip"
              android:background="@drawable/btn_user_create_account"
              android:layout_above="@+id/or_layout"
              android:layout_marginBottom="24dp"
              android:text="@string/create_account"
              android:id="@+id/btn_create_account"
              android:layout_marginEnd="12dip"
              android:layout_marginStart="12dip"
              android:gravity="center_horizontal|center_vertical"
              android:textColor="@color/text_color"
              android:textAllCaps="false"
              android:onClick="@{() -&gt; viewmodel.redirectToRegisterActivity()}"
              android:fontFamily="@font/vollkron"
              android:textStyle="bold"
      /&gt;
      &lt;Button
              android:layout_width="match_parent"
              android:layout_height="40dip"
              android:background="@drawable/btn_user_login_reg"
              android:layout_above="@+id/btn_create_account"
              android:layout_marginBottom="12dp"
              android:text="@string/login"
              android:id="@+id/btn_login"
              android:layout_marginEnd="12dip"
              android:layout_marginStart="12dip"
              android:gravity="center_horizontal|center_vertical"
              android:textColor="@color/white"
              android:textAllCaps="false"
              android:onClick="@{() -&gt; viewmodel.executeEmailLogin(context)}"
              android:fontFamily="@font/vollkron"
              android:textStyle="bold"/&gt;
   &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p> </p>
  
  <p>Here is my ViewModel code :   </p>
  
  <pre><code>class LoginViewModel(application: Application) : AndroidViewModel(application) {
  
  
  var email: ObservableField&lt;String&gt;? = null
  var password: ObservableField&lt;String&gt;? = null
  var progressDialog: SingleLiveEvent&lt;Boolean&gt;? = null
  var launchRegisterActivity: SingleLiveEvent&lt;Boolean&gt;? = null
  var userLogin: LiveData&lt;User&gt;? = null
  
  init {
      progressDialog = SingleLiveEvent&lt;Boolean&gt;()
      launchRegisterActivity = SingleLiveEvent&lt;Boolean&gt;()
      email = ObservableField("")
      password = ObservableField("")
      userLogin = MutableLiveData()
  }
  
  fun redirectToRegisterActivity() {
      launchRegisterActivity?.value = true
  }
  
  fun executeEmailLogin(context: Context)  {
      progressDialog?.value = true
      val user = User(
          email = email.toString(),
          password = password.toString(),
          )
  
      userLogin = UserRepository.getInstance().registerUserUsingEmail(context, user)
  
  }
  
  }   
  </code></pre>
  
  <p>Here is my Login Activity   </p>
  
  <pre><code>class LoginActivity : AppCompatActivity() {
  
  var binding: ActivityLoginBinding? = null
  var viewModel: LoginViewModel? = null
  var customProgressDialog: CustomProgressDialog? = null
  
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      FacebookSdk.sdkInitialize(applicationContext);
  
      binding = DataBindingUtil.setContentView(this, R.layout.activity_login)
      customProgressDialog = CustomProgressDialog(this)
      viewModel = ViewModelProviders.of(this).get(LoginViewModel::class.java)
      observeViewModel(viewModel!!)
  }
  
  private fun observeViewModel(viewModel: LoginViewModel) {
      viewModel.progressDialog?.observe(this, Observer {
          if (it!!) customProgressDialog?.show() else customProgressDialog?.dismiss()
      })
  
      viewModel.launchRegisterActivity?.observe(this, Observer {
          if (it!!) startActivity(Intent(this, RegisterActivity::class.java))
      })
  
      viewModel.userLogin?.observe(this, Observer { user -&gt;
          // redirect user to home scree
          Toast.makeText(this, "welcome, ${user?.user_name}", Toast.LENGTH_LONG).show()
      })
  
  }
  </code></pre>
  
  <p>}    </p>
  
  <p>Can you please help me to understand what things I am doing wrong here.  Do I implemented mvvm correctly?</p>
  
  <p>Any button click is not working.  </p>