title: two-way databinding
body: <p>I have a problem with two-way databindig. Here are my classes:</p>
  
  <pre><code>public class User extends BaseObservable {
  private String name;
  private String surname;
  private Address address;
  
  public User() {
  }
  
  public User(String name, String surname) {
      this.name = name;
      this.surname = surname;
  }
  
  @Bindable
  public Address getAddress() {
      return address;
  }
  
  public void setAddress(Address address) {
      this.address = address;
      notifyPropertyChanged(BR.address);
  }
  
  @Bindable
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
      notifyPropertyChanged(BR.name);
  }
  
  @Bindable
  public String getSurname() {
      return surname;
  }
  
  public void setSurname(String surname) {
      this.surname = surname;
      notifyPropertyChanged(BR.surname);
  }
  }
  
  public class Address extends BaseObservable {
  private String name;
  
  public Address(String name) {
      this.name = name;
  }
  
  @Bindable
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  }
  </code></pre>
  
  <p>I am trying to bind User in xml file, but also i want to bind address name. Unfortunately when I use address.setName("abc") my UI doesn't change. I was using notifyPropertyChanged(BR.address) in address setter but it didn't help. It is possible to do it in that way? Here are snippets of my xml file:</p>
  
  <pre><code>    &lt;data&gt;
              &lt;variable name="user" type="com.rolnik.test.User"/&gt;
          &lt;/data&gt;
  
  android:text="@={user.name}"
  android:text="@={user.surname}"
  android:text="@={user.address.name}"
  </code></pre>