Code example for Button

Methods: setEnabled, setVisibility

0
                lastPosition = position;
                okButton.setEnabled(true);
                okButton.setVisibility(View.VISIBLE);
            } else { 
                lastPosition = -1;
                okButton.setEnabled(false);
                okButton.setVisibility(View.INVISIBLE);
            } 
            adapter.notifyDataSetChanged();
        } 
    } 
 
    public static class Option implements Comparable<Option> {
        private final String name;
        private final String path;
        private boolean checked = false;
 
        public Option(String name, String path) {
            this.name = name;
            this.path = path;
        }