How to detect special characters in an edit text and display a Toast in response (Android)?

前端 未结 6 1829
既然无缘
既然无缘 2021-01-01 01:06

An apology for my bad English, I\'m using google translate.

I\'m creating an activity in which users must create a new profile. I put a limit to edit text of 15 char

6条回答
  •  既然无缘
    2021-01-01 01:51

    Use:

    public void click (View view) {
    
        if (edittext.matcher(abcd).find ()) {
           Toast.maketext(this, "abcd Found", TOAST.LENGTH_LONG).show ();
        }
    
    }
    

提交回复
热议问题