0

I use a AutoCompleteTextView for login form. But i want remove a character if he is here.

Exemple : User login is : 784589. But if we write !784589, we delete "!" character.

It's possible ?

PotatoesPower
  • 94
  • 1
  • 9
  • https://stackoverflow.com/questions/5216272/replace-string-with-another-in-java – Shmuel Apr 30 '17 at 16:35
  • I don't know really what is the function who i need to use. I just want remove a character from AutoCompletetextView. Or detect if we have this character – PotatoesPower Apr 30 '17 at 17:27

1 Answers1

0

I've found a solution :

 AutoCompleteTextView textView5 = (AutoCompleteTextView) findViewById(R.id.userName);

        if (textView5.getText().toString().contains("#")) {
            textView5.setError(getResources().getString(R.string.connect_error));
        }
        else{
            (...)
        }
PotatoesPower
  • 94
  • 1
  • 9