开发者

edit text in android

hi i want to restrict the special characters (!,@,#,$ etc.) from entering in to Edit Text field in android. how to do this please any body help.. t开发者_StackOverflow社区hnx.


You need to use input filter and set it on Edit Text with setFilters method


You need to look at the reference. EditTest inherits from TextView: http://developer.android.com/reference/android/widget/TextView.html

There you can add an TextChangedListener:
addTextChangedListener(TextWatcher watcher)

Then you test for your special characters and remove them if they are found

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜