Android Question Edittext Alpha Numeric input

Discussion in 'Android Questions' started by Roger Daley, Jul 9, 2015.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi All

    Is there a way to limit Edittext input to letters and digits only [IE No special charactres that may be rejected as a file name]?

    Regards Roger
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Thanks Erel,

    I've already been there twice, I seem to be missing something. It gives promise of doing what I want but lacks details for the uninitiated.

    Regards Roger
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Something like:
    Code:
    IME.SetCustomFilter(EditText3, EditText3.INPUT_TYPE_TEXT, "0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    Do note that it is the responsibility of the soft keyboard app to respect this filter. So your app should expect invalid inputs as well.
     
    DonManfred likes this.
  5. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Ah! The light bulb has turned on.

    Thanks Erel,

    Now that I can see it, I can't understand why I couldn't see it before. :rolleyes:

    Regards Roger
     
Loading...