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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -