title: Android ListView notifyDataSetChanged not working properly
body: <p>Hi I am creating a chat application I am uploading, downloading images, videos etc. Everything working fine. I want the user to notify that the percentage of downloading/uploading. Now my issue is when I call notifyDataSetChanged list reach the last position of the list. I find out this is because of my all the list items are reloading. How can I handle this?</p>
  
  <p>My refill adapter code is below...</p>
  
  <pre><code>public synchronized void refill(ArrayList&lt;ChatMessagesNew&gt; chatmsg) {
          this.chatMessages.clear();
          this.chatMessages.addAll(chatmsg);
          int count = chatmsg.size();
          if (numberOfMessage &lt; count) {
              notifyDataSetChanged();
              numberOfMessage = count;
          }else{
          }
  
      }
  </code></pre>
  
  <p>In the above code numberOfMessage  and count is based on a total number of messages. </p>
  
  <p>How can I handle this?</p>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>I am calling refill method like this...</p>
  
  <pre><code> private void refreshListView(){
          ArrayList&lt;ChatMessagesNew&gt; chatmsg = new ArrayList&lt;ChatMessagesNew&gt;();
          chatmsg = getChatMessage(chatmsg);
          if (lvMessages.getAdapter() == null) {
  
              chatAdapter = new ChatAdapter(ChatActivity.this, jid, lvMessages,chatmsg);
              lvMessages.setAdapter(chatAdapter);
  
          } else {
              ((ChatAdapter) lvMessages.getAdapter()).refill(chatmsg);
          }
      }
  </code></pre>
  
  <p>Note:  If you need any more details please leave your comments.</p>
  
  <p>** I am using BaseAdapter....</p>