Code example for AutoCompleteTextView

Methods: getTextsetText

0
        final ImageView closeBtn = (ImageView) menuItem.getActionView().findViewById(R.id.search_close_btn);
        closeBtn.setOnClickListener(new OnClickListener() {
 
            @Override 
            public void onClick(View v) {
                if (!TextUtils.isEmpty(editText.getText())) {
                    editText.setText(null);
                } else { 
                    menuItem.collapseActionView();
                } 
            } 
        }); 
 
        return menuItem;
    } 
 
    /** 
     * Shows the keyboard. 
     * 
     * @param view 
Stop searching for code, let great code find you!  Add Codota to your java IDE