title: Android Databinding not updating UI when data changes in the model
body: <p>I have a model CricketModel </p>
  
  <pre><code>public class CricketModel extends BaseObservable{
      private String score;
      @Bindable
      public String getScore(){
          return score
      }
      public void setScore(String s){ 
          score=s;
          notifyPropertyChanged(BR.score); 
     }
  }
  </code></pre>
  
  <p>When I call API I get JSONArray, I convert them to CricketModel and add it to a CricketModel list. And pass this list to adapter to display them in the Recycler view. </p>
  
  <p>This is my <code>item_cricket.xml</code></p>
  
  <pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;data&gt;
          &lt;variable
              name="cm"
              type="com.panasonic.arbohub.cricket.model.CricketModel" /&gt;
      &lt;/data&gt;
  
      &lt;LinearLayout xmlns:app="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
          &lt;android.support.v7.widget.CardView
              android:id="@+id/cv_main"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="@dimen/dp_8"
              android:layout_marginLeft="8dp"
              android:layout_marginRight="8dp"
              android:layout_marginTop="8dp"
              card_view:cardCornerRadius="5dp"
              card_view:cardElevation="3dp"&gt;
  
              &lt;FrameLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
                 &lt;TextView
                          android:id="@+id/tv_two_s_score"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_below="@id/tv_one_p_score"
                          android:layout_marginEnd="@dimen/dp_16"
                          android:layout_marginTop="@dimen/dp_8"
                          android:layout_toStartOf="@+id/rl_team_two"
                          android:textSize="@dimen/sp_12"
                          android:textStyle="bold"
                          android:text="@{cm.score}"
                          android:visibility="visible" /&gt;
              &lt;/FrameLayout&gt;
          &lt;/android.support.v7.widget.CardView&gt;
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>This is my <code>ViewHolder</code></p>
  
  <pre><code>private class CricketViewHolder extends RecyclerView.ViewHolder {
           ItemCricketBinding itemCricketBinding;
  
         public CricketViewHolder(ItemCricketBinding binding) {
            super(binding.getRoot());
            itemCricketBinding = binding;
         }
        public void bind(CricketModel cm){
            itemCricketBinding.setCm(cm);
            itemCricketBinding.executePendingBindings();
        }
      }
  </code></pre>
  
  <p>In my <code>CricketAdapter.java</code></p>
  
  <pre><code> holder.bind(cricketModelList.get(position));
  </code></pre>
  
  <p>API updates once in 1 mi, I'm replacing the cricketModelList with new data that is coming from the API but data is not reflecting in the UI. </p>
  
  <p>Have followed this- <a href="https://medium.com/google-developers/android-data-binding-recyclerview-db7c40d9f0e4" rel="nofollow noreferrer">https://medium.com/google-developers/android-data-binding-recyclerview-db7c40d9f0e4</a></p>
  
  <p><strong>Update:</strong>
  After api has been called. I added notifyDataSetChanged() onClickOfthe item view, then new data is reflecting. So model has the new data but its not notifying the UI.</p>