Code example for List

Methods: contains, remove

0
    public void addListener(ImportanceChangedListener listener) {
        listeners.add(listener);
    } 
 
    public void removeListener(ImportanceChangedListener listener) {
        if (listeners.contains(listener))
            listeners.remove(listener);
    } 
 
    @Override 
    protected void afterInflate() { 
        LinearLayout container = (LinearLayout) getView().findViewById(R.id.importance_container);
 
        int min = Task.IMPORTANCE_MOST;
        int max = Task.IMPORTANCE_LEAST;
 
        DisplayMetrics metrics = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
 
        int width = (int) (metrics.widthPixels / metrics.density) - 20;
        int usedWidth = 0;