Home > Mobile >  How can I limit digit mobile phone number
How can I limit digit mobile phone number

Time:11-22

When click the modify button, mobile phone number can only be modified for 11 successful method,
If you can give the code will be better, thank you

CodePudding user response:

Understand the regular under reference https://blog.csdn.net/Water_Marking/article/details/100780504

CodePudding user response:

When you call to judge the length is 11

CodePudding user response:

To limit the length of the input android: maxLength="11"

CodePudding user response:

This judgment get directly to the input of the length of the string is not line

CodePudding user response:

It seems there is still a long road ~!

CodePudding user response:

Public void addTextChangedListener (TextWatcher watcher)

CodePudding user response:

If just keep 11, limiting the edittext length is the most simple, limited input digital,
Is fastidious, research the regular expression, this once and for all,
The ultimate way, you can also customize a EditText,
  • Related