title: Is it possible to use MutableLiveData with an array of object?
body: <p>There's a fragment on the app I'm working on that the user needs to fill up to 6 <code>EditText</code>. Each pair of <code>EditText</code> represents the type and description of the user's address (as in "Apartment" as the Type and "1201" as the description). According to Brazil's postal service company, it is possible to add up to 3 complements.</p>
  
  <p>At default, I'm showing one pair of <code>EditText</code> that represents the first complement. There's a button that let the user add two more address complements.</p>
  
  <p>I want to use <code>LiveData</code> and <code>DataBinding</code> to update an array of Complements on my ViewModel but it isn't working and I have no idea why.</p>
  
  <p>Is it possible to work with arrays and <code>MutableLiveData</code>?</p>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;android.support.design.widget.TextInputLayout
      android:id="@+id/tipo1"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginStart="8dp"
      android:layout_marginEnd="8dp"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@+id/textView"&gt;
  
      &lt;android.support.design.widget.TextInputEditText
          android:id="@+id/tipo1edit"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:hint="Tipo 1"
          android:text="@={viewModel.complementoList.getValues().get(0).descricao}" /&gt;
  
  &lt;/android.support.design.widget.TextInputLayout&gt;
  </code></pre>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>private MutableLiveData&lt;ArrayList&lt;Complemento&gt;&gt; complementoList;
  
  public MutableLiveData&lt;ArrayList&lt;Complemento&gt;&gt; getComplementoList() { 
      if (complementoList == null) {
          complementoList = new MutableLiveData&lt;&gt;();
  
          ArrayList&lt;Complemento&gt; arrayComplemento = new ArrayList&lt;&gt;();
          arrayComplemento.add(new Complemento());
          arrayComplemento.add(new Complemento());
          arrayComplemento.add(new Complemento());
  
          complementoList.setValue(arrayComplemento);
      }
  
      return complementoList;
  }
  </code></pre>
  
  <p><strong>Fragment</strong></p>
  
  <pre><code>final Observer&lt;ArrayList&lt;Complemento&gt;&gt; complementoList = new Observer&lt;ArrayList&lt;Complemento&gt;&gt;() {
      @Override
      public void onChanged(@Nullable ArrayList&lt;Complemento&gt; complementos) {
          //update stuff here
      }
  };
  mViewModel.getComplementoList().observe(this, complementoList);
  </code></pre>