Code example for Editable

Methods: toString

0
            mListener.onFilterChange(trim(s));
        } 
    } 
 
    private String trim(Editable s) {
        return s.toString().trim();
    } 
 
    /** 
     * Event handler for search UI. 
     */ 
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            hideSoftKeyboard(); 
            if (TextUtils.isEmpty(trim(getText())) && mListener != null) {
                mListener.onCancelSearch();
            } 
            return true; 
        } 
        return false; 
    }