-6

I want to show in Signup Part of My app.In signup if user enter duplicate name then "username already exists " error msg should be shown.anyone help me.....??

Vidya
  • 3
  • 6

2 Answers2

0

Try this,

Toast.makeText(MainActivity.this, "Username already exists.", Toast.LENGTH_SHORT).show();
Parth Bhayani
  • 1,894
  • 3
  • 17
  • 35
0
//If username Already Exists
            if (userName.equals(storedUsername)) {
                Toast.makeText(getApplicationContext(),
                        "Username Already Exists!!!", Toast.LENGTH_LONG)
                        .show();
                return;
            }
Vidya
  • 3
  • 6