本文整理匯總了Java中android.widget.AutoCompleteTextView.Validator方法的典型用法代碼示例。如果您正苦於以下問題:Java AutoCompleteTextView.Validator方法的具體用法?Java AutoCompleteTextView.Validator怎麽用?Java AutoCompleteTextView.Validator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.AutoCompleteTextView
的用法示例。
在下文中一共展示了AutoCompleteTextView.Validator方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setValidator
import android.widget.AutoCompleteTextView; //導入方法依賴的package包/類
/**
* Sets the validator used to perform text validation.
* <p>Only work when autoComplete mode is {@link #AUTOCOMPLETE_MODE_SINGLE} or {@link #AUTOCOMPLETE_MODE_MULTI}</p>
*
* @param validator The validator used to validate the text entered in this widget.
*
* @see #getValidator()
* @see #performValidation()
*/
public void setValidator(AutoCompleteTextView.Validator validator) {
if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE)
return;
((AutoCompleteTextView)mInputView).setValidator(validator);
}
示例2: getValidator
import android.widget.AutoCompleteTextView; //導入方法依賴的package包/類
/**
* Returns the Validator set with {@link #setValidator},
* or <code>null</code> if it was not set.
* <p>Only work when autoComplete mode is {@link #AUTOCOMPLETE_MODE_SINGLE} or {@link #AUTOCOMPLETE_MODE_MULTI}</p>
*
* @see #setValidator(AutoCompleteTextView.Validator)
* @see #performValidation()
*/
public AutoCompleteTextView.Validator getValidator() {
if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE)
return null;
return ((AutoCompleteTextView)mInputView).getValidator();
}