title: How to refresh list View in android?
body: <p>I am using .net web services. I am trying to get list in <code>ListView</code>. Right now it is showing me the first list, but when I am trying to get it again using the same method it is giving me a response in log but not displaying in list.</p>
  
  <p>I have used <code>mAdapter.notifyDataSetChanged();</code> in my <code>Adapter</code> but it's not working. Please help. thanks</p>
  
  <p>My code:</p>
  
  <pre><code>Intent mIntent = getIntent();
      mIntent.getStringExtra("folder_name");
      Id = mIntent.getStringExtra("folder_ID");
      mIntent.getStringExtra("item_parent");
      User_ID = mIntent.getStringExtra("User_ID");
  
      subfolderTreedata();   
  }
      public void subfolderTreedata() {
      try {
    --------
    --------
    --------  //some code here...
  
   SoapObject SubfolderResponse = (SoapObject)envelope.getResponse();
  
          Log.i("SubFolders", SubfolderResponse.toString());
  
          String File_Ext=" ";
  
          subfoldersitem = new String[SubfolderResponse.getPropertyCount()];
  
          System.out.println(subfoldersitem.length);
  
          for(int i=0; i &lt; SubfolderResponse.getPropertyCount(); i++) {
              SoapObject SingleSubFolder = (SoapObject)SubfolderResponse.getProperty(i);
  
              subfoldersitem[0] = SingleSubFolder.getProperty(1).toString();
              subfoldersitem[1] = SingleSubFolder.getProperty(0).toString();
              subfoldersitem[2] = SingleSubFolder.getProperty(3).toString();
  
              if(KEY_SUBJECTTYPE.equalsIgnoreCase("Folder")) {
  
              item = new FolderList(Folderimages[0], subfoldersitem[0], subfoldersitem[1], subfoldersitem[2]);
              Subfolderdata.add(item);
  
              } else{
  
                  StringTokenizer tokens = new StringTokenizer(Name, ".");
                  @SuppressWarnings("unused")
                  String first_string = tokens.nextToken();
                  File_Ext = tokens.nextToken();
  
                      if(File_Ext.equalsIgnoreCase("TIF")) {
                          item = new FolderList(TIFimages[0], subfoldersitem[0], subfoldersitem[1], subfoldersitem[2]);
                          Subfolderdata.add(item);
  
                      } else {
                          item = new FolderList(noImage[0], subfoldersitem[0], subfoldersitem[1], subfoldersitem[2]);
                          Subfolderdata.add(item);  }
          }
      }
              subfolderslistview = (ListView)findViewById(R.id.subfolderslistview);
  
              mAdapter = new LazyAdapter(this, R.layout.jpg_row, Subfolderdata);
              subfolderslistview.setAdapter(mAdapter);
              mAdapter.notifyDataSetChanged();
  
              subfolderslistview.setOnItemClickListener(new OnItemClickListener() {
  
                  public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {
  
                      LazyAdapter ca = (LazyAdapter)parent.getAdapter();
                      FolderList item_name = (FolderList)ca.getItem(position);
                      FolderList DocumentID = (FolderList)ca.getItem(position);
                      FolderList type = (FolderList)ca.getItem(position);
  
                      Intent mIntent = new Intent();  
                      mIntent.putExtra("item_name", item_name.folder_name);
                      mIntent.putExtra("item_id", DocumentID.ID);
                      mIntent.putExtra("item_type", type.type);
  
                      mIntent.getStringExtra("item_name");
  
                      String Type = mIntent.getStringExtra("item_type");
  
                      Log.i("Type", Type);
  
                      if(Type.equalsIgnoreCase("Folder")){
  
                          Id = mIntent.getStringExtra("item_id");
                          mAdapter.notifyDataSetChanged();
                          subfolderTreedata();
  
                      } else {
  
                          Intent i = new Intent(getApplicationContext(), Display_image.class);
                          i.putExtra("item_name", item_name.folder_name);
                          i.putExtra("ID", DocumentID.ID);
                          i.putExtra("item_type", type.type);
                          i.putExtra("User_ID",User_ID);
  
                          i.getStringExtra("item_name");
                          Id = i.getStringExtra("ID");
                          i.getStringExtra("item_type");
                          Log.i("id", Id);
                          startActivity(i);
                          }
                       }
                   });
  </code></pre>