title: Binding not working - how to?
body: <p>I can't understand why my java bean properties it's not updated after the user has changed the text in some textfield. I have configured the pojo and binding but it's not working. Can someone explain me why is not working?
  The binding is working just in the beggining if i initialized the bean in onCreate method using setter. But changes are not merged in the user bean when Im calling onSignup method.</p>
  
  <p>activity_registration.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;data&gt;
          &lt;variable name="user" type="main.client.android.musichall.registration.model.User" /&gt;
      &lt;/data&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          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"
          android:padding="@dimen/activity_horizontal_margin"
          tools:context="main.client.android.musichall.registration.RegistrationActivity"&gt;
  
      &lt;Spinner
          android:id="@+id/spinner"
          android:layout_width="368dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          tools:listitem="@array/activity_registration_modes" /&gt;
  
      &lt;TextView
          android:id="@+id/activity_registration_text_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          app:layout_constraintTop_toBottomOf="@+id/spinner"
          tools:layout_editor_absoluteX="8dp"
          android:text="@string/activity_registration_text_name" /&gt;
  
      &lt;EditText
          android:id="@+id/activity_registration_text_field_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:ems="10"
          android:inputType="textPersonName"
          app:layout_constraintTop_toBottomOf="@+id/activity_registration_text_name"
          tools:layout_editor_absoluteX="8dp"
          android:text="@{user.name}"/&gt;
  
      &lt;TextView
          android:id="@+id/activity_registration_text_email"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:text="@string/activity_registration_text_email"
          app:layout_constraintTop_toBottomOf="@+id/activity_registration_text_field_name"
          tools:layout_editor_absoluteX="8dp" /&gt;
  
      &lt;EditText
          android:id="@+id/activity_registration_text_field_email"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="12dp"
          android:ems="10"
          android:inputType="textEmailAddress"
          app:layout_constraintTop_toBottomOf="@+id/activity_registration_text_email"
          tools:layout_editor_absoluteX="8dp"
          android:text="@{user.email}"/&gt;
  
      &lt;TextView
          android:id="@+id/activity_registration_text_password"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:text="@string/activity_registration_text_password"
          app:layout_constraintTop_toBottomOf="@+id/activity_registration_text_field_email"
          tools:layout_editor_absoluteX="8dp" /&gt;
  
      &lt;EditText
          android:id="@+id/activity_registration_text_field_password"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:ems="10"
          android:inputType="textPassword"
          android:text="@{user.password}"
          app:layout_constraintTop_toBottomOf="@+id/activity_registration_text_password"
          tools:layout_editor_absoluteX="8dp" /&gt;
  
      &lt;Button
          android:id="@+id/activity_registration_button_sign_up"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginBottom="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:text="@string/sign_up"
          android:onClick="onSignUpClick"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent" /&gt;
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
  &lt;/layout&gt;
  </code></pre>
  
  <p>RegistrationActivity.java</p>
  
  <pre><code>package main.client.android.musichall.registration;
  
  import android.content.Intent;
  import android.databinding.DataBindingUtil;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  
  import main.client.android.musichall.R;
  import main.client.android.musichall.databinding.ActivityRegistrationBinding;
  import main.client.android.musichall.login.LoginActivity;
  import main.client.android.musichall.registration.model.User;
  
  public class RegistrationActivity extends AppCompatActivity {
  
      private static RegistrationPresenter presenter;
      private ActivityRegistrationBinding binding;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_registration);
          presenter = new RegistrationPresenter(this);
          binding = DataBindingUtil.setContentView(this, R.layout.activity_registration);
          User user = new User();
          binding.setUser(user);
  
      }
  
      public void onSignUpClick (View view) {
          User user = binding.getUser();
          user.getEmail();
          presenter.onSignUpClick(user);
      }
  
      public void onSignUpDone(User user) {
          startActivity(new Intent(this, LoginActivity.class));
      }
  }
  </code></pre>
  
  <p>User.class</p>
  
  <pre><code>package main.client.android.musichall.registration.model;
  
  import android.databinding.BaseObservable;
  import android.databinding.Bindable;
  
  import main.client.android.musichall.BR;
  
  /**
   * Created by sangra on 02/12/17.
   */
  
  public class User extends BaseObservable{
  
      private String name;
      private String username;
      private String email;
      private String password;
  
      @Bindable
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
          notifyPropertyChanged(BR.name);
      }
  
      @Bindable
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username = username;
          notifyPropertyChanged(BR.username);
      }
  
      @Bindable
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
          notifyPropertyChanged(BR.email);
      }
  
      @Bindable
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
          notifyPropertyChanged(BR.password);
      }
  }
  </code></pre>