title: Delete item on ListView after click delete button on ListView
body: <p>I wrote a code to display images, button &amp; texts dynamically in a ListView.
  So ListView load the button. I want to delete the selected item in ListView by clicking this button.</p>
  
  <p>Adapter class:</p>
  
  <pre><code>public class LazyAdapter extends BaseAdapter {
  
      private Activity activity;
      private String[] data;
      private static LayoutInflater inflater=null;
      public ImageLoaderLogoUnder imageLoader; 
  
      public LazyAdapter(Activity a, String[] d) {
          activity = a;
          data=d;
          inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          imageLoader=new ImageLoaderLogoUnder(activity.getApplicationContext());
      }
  
      public int getCount() {
          return data.length;
      }
  
      public Object getItem(int position) {
          return position;
      }
  
      public long getItemId(int position) {
          return position;
      }
  
      public View getView(int position, View convertView, ViewGroup parent) {
          View vi=convertView;
          if(convertView==null)
              vi = inflater.inflate(R.layout.inflatelistview, null);
  
          TextView text=(TextView)vi.findViewById(R.id.textView1);
          ImageView image=(ImageView)vi.findViewById(R.id.imageView1);
          Button btn=(Button)vi.findViewById(R.id.button1);
          btn.setTag(position);
          btn.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  Integer index = (Integer) v.getTag();
                  //items.remove(index.intValue());  
                  notifyDataSetChanged();
  
              }
          });
          text.setText("item "+position);
          imageLoader.DisplayImage(data[position], image);
          return vi;
      }
  }
  </code></pre>
  
  <p>This is a ListView Activity class</p>
  
  <pre><code>ShowData show = new ShowData();
  
          String s[] = show.getData();
          adapter = new LazyAdapter(this, s);
  
          inflater = (LayoutInflater) this
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          list = (ListView) findViewById(R.id.listView1);
          list.setAdapter(adapter);
  </code></pre>
  
  <p>How to do this?</p>