I have a toast message that doesn't disappear after execution. Im guessing it has something to do with it being in the loop but I'm not sure. Can someone help me figure out what why the toast message doesn't disparate?
@Override
public void onClick(View v) {
int index = 0;
for(int i= 0; i<userArray.length; i++){
if(email.getText().toString().equals(userArray[i])){
index = i;
}
if(passArray[index].equals(password.getText().toString())){
Toast.makeText(getBaseContext(), "SUCCESS!", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getBaseContext(), "INVALID LOGIN", Toast.LENGTH_SHORT).show();
}
}
Intent mainIntent = new Intent(LoginActivity.this, MainActivity.class);
startActivityForResult(mainIntent, 0);
}
}