How to store the empty value in arraylist in android?
<p>In my project I created an <strong>arraylist to store selected checkboxes values</strong>. i.e If a checkbox is selected I am storing the id value of it in the arraylist and if it is unselected I am deleting that from the arraylist. <strong>Also if no checkbox is selected or unselected in that page I am storing "00" in the arraylist.</strong> The <strong>if and elseif conditions are working fine</strong> in my code but the *<em>else part is not working..</em>*Where I went wrong? Please help me regarding this....  </p>

<p>My Code:</p>

<pre><code>public static ArrayList&lt;String&gt; selchkboxlist = new ArrayList&lt;String&gt;();

cbs[k].setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        if (((CheckBox) v).isChecked()) {
            selchkboxlist.add(Integer.toString(v.getId()));
            System.out.println("chkboxlist size" + selchkboxlist.size());
            System.out.println("selected checkboxes" + selchkboxlist);
        } 
        else if(!(((CheckBox) v).isChecked()))
        {
            selchkboxlist.remove(Integer.toString(v
                    .getId()));
            System.out.println("after delete chkboxlist size" + selchkboxlist.size());
            System.out.println("un selected checkboxes" + selchkboxlist);
        }
        else
        {
            selchkboxlist.add("00");
            System.out.println("nothing selected selected checkboxes"
                    + selchkboxlist);
        }
    }
});
</code></pre>
