title: Android data binding - unable to invoke the click handler
body: <p>I have created a simple login screen using the databinding as described at <a href="http://developer.android.com/tools/data-binding/guide.html" rel="nofollow noreferrer">http://developer.android.com/tools/data-binding/guide.html</a> however I am unable to get the notification of text changed from </p>
  
  <ol>
  <li>the text box or</li>
  <li>the button click.</li>
  </ol>
  
  <p>I think for the text box notification, the android team might not have implemented it completely. However, I fail to understand my mistake for the button click handler.</p>
  
  <p>The fragment code looks like </p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      FragmentAccountSetupInitialBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_account_setup_initial, container, false);
      View view = binding.getRoot();
  
      binding.setAccount(new UserAccount());
      return view;
  }
  </code></pre>
  
  <p>The ViewModel for user account is as defined below</p>
  
  <pre><code>public class UserAccount extends BaseObservable {
      private String _email;
      private String _password;
  
      @Bindable
      public String getEmail() {
          return _email;
      }
  
      public void setEmail(String email) {
          if(!TextUtils.equals(_email, email)) {
              _email= email;
              notifyPropertyChanged(BR.email);
          }
      }
  
  
      @Bindable
      public String getPassword() {
          return _password;
      }
  
      public void setPassword(String password) {
          if(!TextUtils.equals(_password, password)) {
              _password = password;
              notifyPropertyChanged(BR.password);
          }
      }
  
      public void onSignInButtonClick(View view) {
          // Sign in now
      }
  }
  </code></pre>
  
  <p>And the fragment layout is </p>
  
  <pre><code>&lt;layout
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;data&gt;
          &lt;variable name="account" type="project.namespace.UserAccount"/&gt;
      &lt;/data&gt;
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;LinearLayout
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:paddingTop="56dp"
              android:paddingLeft="24dp"
              android:paddingRight="24dp"&gt;
  
              &lt;!-- Email Label --&gt;
              &lt;android.support.design.widget.TextInputLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="8dp"
                  android:layout_marginBottom="8dp"&gt;
                  &lt;android.support.design.widget.TextInputEditText
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:inputType="textEmailAddress"
                      android:hint="@string/email"
                      android:text="@{account.email}"/&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
              &lt;!-- Password Label --&gt;
              &lt;android.support.design.widget.TextInputLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="8dp"
                  android:layout_marginBottom="8dp"&gt;
                  &lt;android.support.design.widget.TextInputEditText
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:inputType="textPassword"
                      android:hint="@string/password"
                      android:text="@{account.password}"/&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
  
              &lt;android.support.v7.widget.AppCompatButton
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="24dp"
                  android:layout_marginBottom="24dp"
                  android:padding="12dp"
                  android:text="@string/signin"
                  android:onClick="@{account.onSignInButtonClick}"/&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/FrameLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Moving to android studio 2.1 beta 2 solves the first problem. Updated the layout as follows</p>
  
  <pre><code>&lt;android.support.design.widget.TextInputEditText
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:inputType="textEmailAddress"
      android:hint="@string/email"
      android:text="@={account.email}"/&gt;
  </code></pre>