title: How to get only newly added data from the Firebase?
body: <p>As i am creating the chat app, for it i am using the Firebase.
  It works perfectly, only one problem which i am getting that each time i am getting whole list of data from Firebase, when new item is added or deleted into it.</p>
  
  <p>What i want that , only newly added record should come from Firebase , not whole list of data.</p>
  
  <p>Please check my below code for it</p>
  
  <pre><code> ArrayList&lt;ChatMessage&gt; MY_ARRAYLIST= new ArrayList&lt;&gt;();
  
          MsgViewHolder viewModel = ViewModelProviders.of(this).get(MsgViewHolder.class);
  
          LiveData&lt;DataSnapshot&gt; liveData = viewModel.getDataSnapshotLiveData();
  
          liveData.observe(this, dataSnapshot -&gt; {
              if (dataSnapshot != null) {
                  MY_ARRAYLIST.clear();  //  I NEED TO CLEAR THE ARRAY-LIST TO GET THE REFRESHED DATA..I DO NOT WANT TO LOAD WHOLE LIST ON EACH TIME
                  if (dataSnapshot.exists())
                      for (DataSnapshot ds : dataSnapshot.getChildren()) {
                          ChatMessage bean = ds.getValue(ChatMessage.class);
  
                          assert bean != null;
                          MY_ARRAYLIST.add(bean);
  
                      }
              }
          });
  </code></pre>
  
  <p>As in above code i am using <code>MY_ARRAYLIST.clear()</code> to clear data, to get the newly added record.On each time  from <code>DataSnapshot</code> , i am getting the whole list of data, whenever new record added or deleted.Is their any method to get only newly added data NOT whole <code>List</code> from Firebase?</p>