title: Custom observable collection android
body: <p>I just came over the beta <em>Databinding</em> library on Android. I went through the developer's guide, yet, I am still uncertain, how to bind, for instance, a spinner to custom collection. The question is, if it is even possible.</p>
  
  <hr>
  
  <p>Here are steps to make all things work.</p>
  
  <ul>
  <li>Create a class that extends ObservableList.OnListChangedCallback.</li>
  <li>Custom collection, that we want to bind to the spinner (or other adapterbased view) should extend ObservableList(or its' siblings) and have the addOnListChangedCallback (onListChangedCallback olcc).</li>
  <li>Create a custom adapter that works with our custom collection.
  ObservableList.OnListChangedCallback should notify the adapter at events, we want to listen.</li>
  <li>Create, written in developer's guide, annotations to xml of corresponding view: import + variable in the data section and app:adapter= by the spinner.</li>
  <li>Create custom static setter for our custom adapter using @BindingAdapter() annotation.</li>
  </ul>