title: Android : How to Refresh list upon item deletion in customized SimpleAdapter
body: <p>May i know how to refresh the ListView item after i have remove a map list item in customized SimpleAdapter ? </p>
  
  <p>I have successfully implement the delete list item with list.remove(position), but when I have tried to called list.notifyAll() function but it gave me error message like " java.lang.IllegalMonitorStateException: object not locked by thread before notifyAll()". </p>
  
  <p>I hope you can help me. Here is the code for custom SimpleAdapter.</p>
  
  <pre><code>public class DeleteAdapter extends SimpleAdapter {
  
      Context context;
      List&lt;? extends Map&lt;String, ?&gt;&gt; list;
      int resource;
      String[] from;
      int[] to;
  
      public FDeleteAdapter(Context context, List&lt;? extends Map&lt;String, ?&gt;&gt; data,
              int resource, String[] from, int[] to) {
          super(context, data, resource, from, to);
  
          this.context = context;
          this.list = data;
          this.resource = resource;
          this.from = from;
          this.to = to;
          // TODO Auto-generated constructor stub
      }
  
      @Override
      public View getView(final int position, View convertView, ViewGroup parent) {
  
          final View row = super.getView(position, convertView, parent);
  
          final Button delete = (Button) row.findViewById(R.id.deletebut);
          final TextView title = (TextView) row.findViewById(R.id.label);
  
          delete.setOnClickListener(new OnClickListener() {
  
              public void onClick(View view) {
  
                  deleteDialog xdialog = new deleteDialog(context, "Delete? ", position) {
  
                      @Override
                      public boolean onOkClicked() {
  
                          list.remove(position);
                          list.notifyAll();
  
                          return true;
                      }
                  };
                  xdialog.show();
              }
          });
  
          return row;
      }
  };
  </code></pre>
  
  <p>Thank you in advance for your help. </p>