Form validation library for Android?

后端 未结 7 2163
自闭症患者
自闭症患者 2020-12-09 09:48

Is there any mature form validation API / library for Android? I\'ve found http://code.google.com/p/android-binding/ but it seems that is under heavy development.

7条回答
  •  醉话见心
    2020-12-09 10:40

    This will be the simple and mature way to validate the input texts or forms:

    private EditText et_first_name;
    et_first_name = (EditText)findViewById(R.id.et_first_name);
    et_first_name = (EditText)findViewById(R.id.et_first_name);
    first_name.matches("^(?i)(?=.{1,20}$)([A-Za-z]+[A-Za-z0-9-_.]*$)"); // use the regex expression inside brackets and returns the error status .
    

提交回复
热议问题