How do I use InputFilter to limit characters in an EditText in Android?

后端 未结 20 1510
慢半拍i
慢半拍i 2020-11-22 04:23

I want to restrict the chars to 0-9, a-z, A-Z and spacebar only. Setting inputtype I can limit to digits but I cannot figure out the ways of Inputfilter looking through the

20条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 04:55

    Use this its work 100% your need and very simple.

    
    

    In strings.xml

    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
    

提交回复
热议问题