How can restrict my EditText input to some special character like backslash(/),tild(~) etc by soft keyboard in android programmatically -


I'm developing an application for the keyboard, but I'm getting an issue. I want to restrict / block some special character in the Android programmatic format using soft keyboard in AdTeText.

So, can I restrict any special character input in the edit text in Android?

If someone has ideas, please answer.

Thanks in advance.

Try it can work for you

  public class Expansion of MainActivity Activity (Private EditingText EditingText; Private String BlockCareEactorSet = "~ # ^ | $% & amp;!!"; Private Input Filter Filter = New Input Filters () {@ Override Public ChessCensing Filtrated (Source Source, Int Start, Int. End, space distance, int durst, intend) {if (source! = Null and blocks character And support (return "" source)) {return "";} return null;}}; @ override protected form to zero (bundle saved instenstate) {super.naught (savedinstenstate); setContentView (R.layout EditText = (edit text) SearchVBIID (RID Edit Text); EditText.setFilters (new input filter [] {filter});}}    

Comments

Popular posts from this blog

sonata admin - how to add ManyToOne property field in configureListfield in sonataAdmin -

sql - Return Function using Cursor -

sql server - How to use pivot in this table -