[Android] mobile guard number attribution query completed

The regular expression completes number verification,

^Starting with a, [] character set (matches any character in brackets), \ D is any number, {n} indicates how many times it occurs, and $ends

The regular ^ 1 [34568] \ d{9} $, starting with 1, the second number is 34568, and the remaining nine are numbers, ending with numbers

Call the match() method of the string object. Parameters: regular (the slash \ inside needs to be escaped)

Text input direct query

Call addtextchangedlistener() method of EditText object to add listener. Parameter: textwatcher object

The anonymous inner class implements the textwatcher interface, overrides the ontextchanged method, and passes in the charsequence object

Query the database and display the results

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>