Code example for AutoCompleteTextView

Methods: setHint

0
    public String getHint() {
        return (String) input.getHint();
    } 
     
    public void setHint(String hint) {
        input.setHint(hint);
    } 
 
    @Override 
    protected void onFinishInflate() { 
        super.onFinishInflate(); 
 
        View.inflate(getContext(), R.layout.view_clearable_edittext, this);
 
        input = (AutoCompleteTextView) findViewById(R.id.view_clearable_edit_text_input);
        input.setHint(hint);
        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);