我想在我的应用程序的注册部分中显示。在注册中,如果用户输入了重复的名称,则应显示"用户名已存在"错误消息。有人帮我吗。。。。。??
试试这个,
Toast.makeText(MainActivity.this, "Username already exists.", Toast.LENGTH_SHORT).show();
//If username Already Exists
if (userName.equals(storedUsername)) {
Toast.makeText(getApplicationContext(),
"Username Already Exists!!!", Toast.LENGTH_LONG)
.show();
return;
}