title: Android LiveData Observer Not Triggered
body: <p>I am trying to add an observer in my activity but it never seems to get triggered.</p>
  <p>I have a button on my app which makes a sensor connected to my phone start measuring data when the sensors are measuring it hits a callback in my <code>XsDevice()</code> class.</p>
  <p>Here is the code in my <code>XsDevice()</code> class</p>
  <pre><code>private MutableLiveData&lt;ArrayList&lt;Float&gt;&gt; accelerationData = new MutableLiveData&lt;&gt;();
  public LiveData&lt;ArrayList&lt;Float&gt;&gt; freeAccDataLiveData = accelerationData;
  
  
  @Override
  public void onXsensDotDataChanged(String s, XsensDotData xsensDotData) {
      ArrayList&lt;Float&gt; result = new ArrayList();
  
      for (Float freeAcc: xsensDotData.getFreeAcc()) {
          result.add(freeAcc);
      }
      accelerationData.postValue(result);
  }
  </code></pre>
  <p>When the callback function is hit I am using <code>postValue(result)</code> to update the <code>accelerationData</code> variable, this is where me being a new to android development comes in.</p>
  <p>I am presuming after I post the value the <code>freeAccDataLiveData</code> variable is updated and this is what I am observing.</p>
  <p>Here is my observer code in my activity</p>
  <pre><code>private XsDevice xsDeviceClass = new XsDevice();
  
  protected void onCreate(Bundle savedInstanceState) {
      ...
      xsDeviceClass.freeAccDataLiveData.observe(this, new Observer&lt;ArrayList&lt;Float&gt;&gt;() {
          @Override
          public void onChanged(ArrayList&lt;Float&gt; freeAccData) {
              for(int i = 0; i &lt; freeAccData.size(); i++){
                  Log.d(&quot;Free Acceleration Data&quot;, String.valueOf(freeAccData.get(i)));
              }
          }
      });
  
  }
  </code></pre>
  <p>The <code>...</code> is just a placeholder for the standard <code>onCreate</code> code I haven't included.</p>
  <p>The issue I am having is <code>Log.d(&quot;Free Acceleration Data&quot;, String.valueOf(freeAccData.get(i)));</code> is never logged which must mean the observer isn't working. If I added this log directly to the callback function it works fine but I need to get the data in my <code>MainActivity</code></p>
  <p>Is there something simple I might have missed?</p>