title: my listview not refresh how to show new values every time
body: <p>im insert arraylist on listview inside function cal that function on background  but problem is if i click multiple times on button listview show duplicate values how to refresh or restrict listview to show only current values every button click remove all previous???
            Button e01;</p>
  
  <pre><code>           static ArrayList&lt;Long&gt; Category_ID = new ArrayList&lt;Long&gt;();
  static ArrayList&lt;String&gt; school_name = new ArrayList&lt;String&gt;();
  static ArrayList&lt;String&gt; menu_name = new ArrayList&lt;String&gt;();
  
  static ArrayList&lt;String&gt; dish_name = new ArrayList&lt;String&gt;();
  static ArrayList&lt;String&gt; day = new ArrayList&lt;String&gt;();
  
  static ArrayList&lt;Long&gt; Vacation_ID = new ArrayList&lt;Long&gt;();
  static ArrayList&lt;String&gt; Vacation_name = new ArrayList&lt;String&gt;();
  static ArrayList&lt;String&gt; Vacation_Date = new ArrayList&lt;String&gt;();
  
  String mydate;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.category_list2);
      }
  
  
  
              void clearData() {
  
      Category_ID.clear();
      school_name.clear();
      menu_name.clear();
      dish_name.clear();
      day.clear();
  
      Vacation_ID.clear();
      Vacation_name.clear();
      Vacation_Date.clear();
  
  }
  
  
  
  
  
  
  
                public class getDataTask extends AsyncTask&lt;Void, Void, Void&gt; {
  
      getDataTask() {
          if (!prgLoading.isShown()) {
              prgLoading.setVisibility(0);
              txtAlert.setVisibility(8);
  
          }
      }
  
      @Override
      protected void onPreExecute() {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      protected Void doInBackground(Void... arg0) {
          // TODO Auto-generated method stub
          parseJSONData();
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          // TODO Auto-generated method stub
          prgLoading.setVisibility(8);
  
          if ((Category_ID.size() &gt; 0) || IOConnect == 0) {
  
              listCategory.setAdapter(cla);
  
  
  
  
  
          } 
      }
  }
  
  
  
  
  
  
                   public void parseJSONData() {
      clearData();
      SelectMenuAPI = Utils.Schoolmenu + Cat_name + "&amp;lid=" + SchoolLevelId;
      zero1check = valll.toString();
  
  
      URL = SelectMenuAPI;
      URL2 = URL.replace(" ", "%20");
  
      SelectMenuAPI2 = Utils.SchoolVacation;
  
      clearData();
      URL3 = SelectMenuAPI2;
      URL4 = URL3.replace(" ", "%20");
  
      if (zero1check.equals("0"))
          byweekdate = Todayday + 1;
      else if (zero1check.equals("1")) {
          byweekdate = Todayday + 2;
  
      }
  
      try {
  
            Log.i("url",""+URL2);
  
          HttpClient client = new DefaultHttpClient();
          HttpConnectionParams
                  .setConnectionTimeout(client.getParams(), 15000);
          HttpConnectionParams.setSoTimeout(client.getParams(), 15000);
          HttpUriRequest request = new HttpGet(URL2);
          HttpResponse response = client.execute(request);
  
          HttpEntity resEntity = response.getEntity();
          _response=EntityUtils.toString(resEntity);
            String str2 = "";
          str2=   _response2;
  
             JSONArray school = json2.getJSONArray("data");
  
                  for (int i = 0; i &lt; school.length(); i++) {
                      JSONObject object = school.getJSONObject(i);
                      if (count == 1) {
                          count = 0;
                          break;
                      } else
  
          if (object.getString("Schedule").equals("weekly")) {
  
      if (object.getString("day").equals(Todayday)) {
      Category_ID.add((long) i);
      school_name.add(object.getString("school_name"));
  
  
         dish_name.add(object.getString("dish_name"));
  
  
           menu_name.add(object.getString("menu_title"));
  
                              day.add(object.getString("day"));
                              count = count + 1;
  
  String[] mVal = new String[school.length()];
  
      for (int k = 0; k &lt; school.length(); k++) {
      mVal[k] = school.getJSONObject(k).getString("menu_title");
          message = "weekly";
              mVal2 = mVal[0];
  
  
  
                              }
  
  
  
  
  
  
  
  
  
  
  
  @Override
  public void onClick(View v) {
      // TODO Auto-generated method stub
      switch (v.getId()) {
  
      case R.id.e01:
              new getDataTask().execute();
  
          break;
  
  
  
  
  
                   public class thirdstepAdapter extends BaseAdapter {
  
      private Activity activity;
  
  String[] Main_menu;
  
  public thirdstepAdapter(Activity act) {
      this.activity = act;
  
  }
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
  //  return Main_menu.length;
      return thirdstep.Category_ID.size();
  }
  @Override
  public Object getItem(int position) {
      // TODO Auto-generated method stub
      return position;
  }
  
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return position;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
      ViewHolder holder;
  
      if(convertView == null){
          LayoutInflater inflater = (LayoutInflater) activity
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inflater.inflate(R.layout.main_menu_item, null);
          holder = new ViewHolder();
  
          convertView.setTag(holder);
      }else{
          holder = (ViewHolder) convertView.getTag();
      }
  
      holder.txtText = (TextView) convertView.findViewById(R.id.txtText);
  
      holder.txtText.setText(thirdstep.dish_name.get(position));
  
      return convertView;
  }
  
  static class ViewHolder {
      TextView txtText;
  }
  
     }
  </code></pre>