title: RecyclerView displays a duplicate of the first item when the list fills the screen
body: <p>I have several items in a ListItemView / RecyclerView. When items are added it correctly updates the view and the items are displayed in the order that they are added. </p>
  
  <p>However, when I go above a number of items so that all the views fill the screen (scrolling becomes possible), it displays the first item again as a duplicate, instead of displaying the latest added item. </p>
  
  <p><strong>My GetView method:</strong></p>
  
  <pre><code>@NonNull
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      View listItemView = convertView;
  
      Log.d(TAG, "The GetView method was called");
  
      ChatConversationMessage currentMessage = getItem(position);
  
      if (listItemView == null) {
          if (currentMessage.getSentTextMessage() != null) {
  
              Log.d(TAG, "Sent message detected");
              // Sent text
              listItemView = LayoutInflater.from(getContext()).inflate(
                      R.layout.chat_conversation_txt_sent, parent, false);
              TextView sentText = listItemView.findViewById(R.id.textview_chat_message_sent);
              sentText.setText(currentMessage.getSentTextMessage());
          }
  
          if (currentMessage.getReceivedTextMessage() != null) {
  
              Log.d(TAG, "Received message detected");
              // Received text
              listItemView = LayoutInflater.from(getContext()).inflate(
                      R.layout.chat_conversation_txt_received, parent, false);
              TextView receivedText = listItemView.findViewById(R.id.textview_chat_message_received);
              receivedText.setText(currentMessage.getReceivedTextMessage());
              ImageView chatHead = listItemView.findViewById(R.id.imageview_chat_head_received);
              chatHead.setImageResource(currentMessage.getImageResourceId());
              chatHead.setClipToOutline(true);
          }
      }
  
      return listItemView;
  }
  </code></pre>
  
  <p><strong>And my getLiveMessages method (From Firestore)</strong></p>
  
  <pre><code>public void getLiveChatMessages(final ArrayList&lt;ChatConversationMessage&gt; messageArrayList, final ChatConversationMessageAdapter adapter) {
  
              messagesCollectionRef.addSnapshotListener(new EventListener&lt;QuerySnapshot&gt;() {
                  @Override
                  public void onEvent(@Nullable QuerySnapshot snapshots,
                                      @Nullable FirebaseFirestoreException e) {
                      if (e != null) {
                          Log.w(TAG, "listen:error", e);
                          return;
                      }
  
                      for (DocumentChange dc : snapshots.getDocumentChanges()) {
  
                          switch (dc.getType()) {
                              case ADDED:
                                  Log.d(TAG, "New message added" + dc.getDocument().getData());
  
                                  if (dc.getDocument().get("Message") != null &amp;&amp; dc.getDocument().get("From user with ID").equals(userID)) {
                                      String message = dc.getDocument().getString("Message");
                                      messageArrayList.add(new ChatConversationMessage(message));
                                      adapter.notifyDataSetChanged(); //Ensures messages are visible immediately
  
                                  } else if (dc.getDocument().get("Message") != null) {
                                      String message = dc.getDocument().getString("Message");
                                      Log.e("TAG", "The received message is written to the array. Message: " + message);
                                      messageArrayList.add(new ChatConversationMessage(message, R.drawable.redhead_1));
  
                                      adapter.notifyDataSetChanged(); //Ensures messages are visible immediately
  
                                  }
                                  Log.d(TAG, "Message ArrayList: " +  messageArrayList);
                                  break;
  
                              case MODIFIED:
                                  Log.d(TAG, "Message modified" + dc.getDocument().getData());
                                  break;
                              case REMOVED:
                                  Log.d(TAG, "Message removed" + dc.getDocument().getData());
                                  break;
                          }
                      }
  
                  }
              });
  }
  </code></pre>