Code example for Vector

Methods: clear

0
import java.util.Vector; 
 
public abstract class BaseListAdapter extends CursorAdapter {
 
    protected LayoutInflater mInflater;
    protected Vector<Integer> mSelectedItems = new Vector<Integer>();
 
    public BaseListAdapter(Context context, Cursor cursor) {
        super(context, cursor);
        this.mInflater = LayoutInflater.from(context);
        this.mSelectedItems.clear();
    } 
 
    /** 
     * Handles click on checkbox for a list item. 
     * @param chkBox Checkbox view 
     * @param id Id assigned to the list item 
     */ 
    protected void toggleCheck(CheckBox chkBox, int id) {
        if (mSelectedItems.contains(id)) {
            mSelectedItems.removeElement(id);