title: listview not updating with notifydatasetchanged() call
body: <p>This is my code</p>
  
  <pre><code>listview =(ListView) findViewById(R.id.lv1);
  
  
      ArrayList&lt;SClass&gt; Monday = new ArrayList&lt;SClass&gt;();
  
      SClass s1=new SClass();
      s1.sName="samp";
      s1.salary=1000;
      Monday.add(s1);
      temp=Monday;
      adapter = new CustomAdap(this, temp);
      listview.setAdapter(adapter);
  </code></pre>
  
  <p>The above code works fine.But when i change my code to this</p>
  
  <pre><code>    listview =(ListView) findViewById(R.id.lv1);
  
  
      adapter = new CustomAdap(this, temp);
  
      SClass s1=new SClass();
      s1.sName="samp";
      s1.salary=1000;
      Monday.add(s1);
      temp=Monday;
  
      listview.setAdapter(adapter);
      adapter.notifyDataSetChanged();
  </code></pre>
  
  <p>Listview does not show anything.what is the problem?</p>