Code example for LinkedList

Methods: indexOf, remove

0
        Extras.add(t);
    } 
 
    public boolean removeExtraFromList(ExtraList t) {
        try { 
            Extras.remove(Extras.indexOf(t));
            return true; 
        } 
        catch (IndexOutOfBoundsException e) {
            Log.e(TAG, "Exception on Deleting Extra from List", e);
            return false; 
        } 
    } 
 
    public int getExtraCount() { 
        return Extras.size();
    } 
}