Code example for ImageButton

Methods: setVisibility

0
        input.setTransformationMethod(new SingleLineTransformationMethod());
        input.addTextChangedListener(new TextWatcher() {
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                if (s.length() > 0) {
                    imageSearch.setVisibility(View.GONE);
                    buttonClear.setVisibility(View.VISIBLE);
                } else { 
                    imageSearch.setVisibility(View.VISIBLE);
                    buttonClear.setVisibility(View.GONE);
                } 
                ClearableEditTextView.this.onTextChanged(s.toString());
                input.setListSelection(-1);
            } 
 
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            } 
 
            public void afterTextChanged(Editable s) {
            } 
        });