title: How to remove a particular list item in list view android?
body: <p>In my application i am using custom adapter for list view. In that list view item
  it have close image. Whenever i click the image that particular row need to be deleted. My problem is if i perform delete operation on first item but the delete operation performed on last item only. Please any one help me out.</p>
  
  <p>My code:</p>
  
  <pre><code> public class PaymentAdapter extends BaseAdapter {
          ArrayList&lt;PaymentData&gt; bpData;
          private ArrayList&lt;PaymentData&gt; arraylist;
          Activity activity;
          private LayoutInflater inflater;
          String orderitemid, orderid;
          ListView recharge_lv;
  
          public PaymentAdapter(Activity activity, ArrayList&lt;PaymentData&gt; bpData, ListView recharge_lv) {
              // TODO Auto-generated constructor stub
              this.activity = activity;
              this.bpData = bpData;
              this.recharge_lv = recharge_lv;
              inflater = LayoutInflater.from(activity);
          }
  
          @Override
          public int getCount() {
              // TODO Auto-generated method stub
              return bpData.size();
          }
  
          @Override
          public Object getItem(int location) {
              // TODO Auto-generated method stub
              return bpData.size();
          }
  
          @Override
          public long getItemId(int position) {
              // TODO Auto-generated method stub
              return position;
          }
  
          @Override
          public View getView(final int position, View convertView, ViewGroup parent) {
              // TODO Auto-generated method stub
              Typeface custom_regular = Typeface.createFromAsset(activity.getAssets(),
                      "fonts/OpenSans-Regular.ttf");
  
              if (inflater == null)
                  inflater = (LayoutInflater) activity
                          .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              if (convertView == null)
                  convertView = inflater.inflate(R.layout.recharge_listitem, null);
  
  
              TextView accountnumber = (TextView) convertView
                      .findViewById(R.id.accountnumber);
              TextView servicename = (TextView) convertView
                      .findViewById(R.id.servicetypname);
              TextView planamount = (TextView) convertView
                      .findViewById(R.id.rechargeamount);
              final ImageView close = (ImageView) convertView
                      .findViewById(R.id.crosse_close_img);
              accountnumber.setTypeface(custom_regular);
              servicename.setTypeface(custom_regular);
              planamount.setTypeface(custom_regular);
              orderitemid = bpData.get(position).getOrderitemID();
              // Log.v("TAG_orderitemid",""+orderitemid);
              orderid = bpData.get(position).getOrderid();
              final LinearLayout layoutrecharge = (LinearLayout) convertView.findViewById(R.id.rechargelay);
              close.setTag(position);
              close.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
  
                      new GetdeleteOrderItem().execute(WebUrl.RechargeServiceURL + "deleteOrderItem");
                      int deletePos = Integer.parseInt(v.getTag().toString());
                      bpData.remove(position);
                      Helper.getListViewSize(recharge_lv);//run it
                      notifyDataSetChanged();
                      reloadcas_cb.setChecked(false);
  
                  }
              });
  
              accountnumber.setText(bpData.get(position).getAccountNumber());
              servicename.setText(bpData.get(position).getServicename());
              planamount.setText("Rs." + bpData.get(position).getRechargeamount());
  
  
              totalamount.setText("Rs " + bpData.get(position).getAmount());
  
              return convertView;
          }
  </code></pre>