Code example for AutoCompleteTextView

Methods: setText

0
 
        buttonClear = (ImageButton) findViewById(R.id.view_clearable_edit_text_button_clear);
        buttonClear.setVisibility(RelativeLayout.GONE);
        buttonClear.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                input.setText("");
                onClear(); 
            } 
        }); 
    } 
 
    private void onTextChanged(String str) {
        if (listener != null) {
            listener.onTextChanged(this, str.trim());
        } 
    } 
 
    private void onClear() { 
        if (listener != null) {
            listener.onClear(this);
        }