Java static ArrayList<Object> remove issue
<p>I have <code>static ArrayList&lt;Batch&gt;</code>. i want to remove which object contain productcode</p>

<p>This is my Batch Entity</p>

<pre><code>public class BatchControl implements Parcelable{
  private String productCode;
  private String lotNumber;
  private String batchSerialNumber;
  private double quantity   ;
  private int sequence;
  private String productName;
  private String type;
  //Setter &amp; getter
 }
</code></pre>

<p>This is my removing object </p>

<pre><code>  static ArrayList&lt;String&gt; lstString = new ArrayList&lt;String&gt;();
  for (Iterator&lt;Batch&gt; i = lstString.iterator(); i.hasNext(); ) {
        Batch value=(Batch )i.next();
        if(value.getSequence() == iVal) {
            lstString.remove(value);
        }
    }
</code></pre>

<p><code>iVal</code> is Android TableLayout contain the row number.</p>

<pre><code>        String number = txtNumber.getText().toString();
    iVal = Integer.parseInt(number);
</code></pre>

<p>But it didn't remove which object have iValue. Because of the resoan static arraylist so, each &amp; every time when i remove size going to change.</p>

<p>Please help me out.</p>

<p>Thanks in advance.</p>
