title: Android group chat display only empty listview without old messages just new messages when user join group
body: <p>ISo i have group chat in my app. I have "rooms" and button join "room", when user click join button all old messages appears on screen but I want to display only new ones, I'm using firebase list adapter for displaying...everything works fine but just don't know how to display empty list and only new messages, ty.</p>
  
  <pre><code>     btnJoin.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              DatabaseReference db = FirebaseDatabase.getInstance().getReference("EventsUsers").child(uniqEventID);
              db.child(user.getUid()).setValue("");
  
  
          }
      });
  
     btnSend.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              DatabaseReference db = FirebaseDatabase.getInstance().getReference("EventsUsers").child(uniqEventID).child("Messages").push();
              db.setValue(new ChatMessage(ePlain.getText().toString(),user.getDisplayName()));
              ePlain.setText("");
              ePlain.requestFocus();
  
          }
      });
      private void displayChat() {
      btnSend.setVisibility(View.VISIBLE);
      eventChat.setVisibility(View.VISIBLE);
      FirebaseListAdapter&lt;ChatMessage&gt; adapter = new FirebaseListAdapter&lt;ChatMessage&gt;(EventDetails.this,ChatMessage.class,R.layout.one_chat_list,FirebaseDatabase.getInstance().getReference("EventsUsers").child(uniqEventID).child("Messages")) {
          @Override
          protected void populateView(View v, ChatMessage model, int position) {
              TextView messageTextm,messageUser,messageTime;
              messageTextm = (TextView) v.findViewById(R.id.chatMessage);
              messageUser = (TextView)v.findViewById(R.id.chatUserName);
              messageTime = (TextView)v.findViewById(R.id.message_time);
  
              messageTextm.setText(model.getMessageText());
              messageUser.setText(model.getMessageUser());
              messageTime.setText(DateFormat.format("dd-MM-yyyy (HH:mm)", model.getMessageTime()));
  
          }
      };
      eventChat.setAdapter(adapter);
  
  }
      DatabaseReference check = FirebaseDatabase.getInstance().getReference("EventsUsers").child(uniqEventID);
              check.addListenerForSingleValueEvent(new ValueEventListener() {
                  @Override
                  public void onDataChange(DataSnapshot dataSnapshot) {
                      if(dataSnapshot.hasChild(user.getUid())){
                          displayChat();
                      }
                  }
  </code></pre>
  
  <p>So when user clicks join button listview with messages displays with all old messages before he joined...and sorry for not uploading any code I am new here, tell me if you need something else of my code
  This is my database structure <a href="https://ibb.co/d47D9v" rel="nofollow noreferrer">https://ibb.co/d47D9v</a></p>