I am trying to toast a string that is pulling from a password EditText but my result is coming up blank.
I am guessing that this is because the edit text is a password type of field and it is encoded somehow but I don't know how else to get around this.
Obviously I don't want to toast the password in the live app, this is for testing purposes, but even in my non-toast test, it still is not working.
Here is my simple code:
public void SubmitRegistration(View view) {
// assign text in fields to string values
EditText first = (EditText)findViewById(R.id.first);
String first2 = first.getText().toString();
EditText last = (EditText)findViewById(R.id.last);
String last2 = last.getText().toString();
EditText display = (EditText)findViewById(R.id.display);
String display2 = display.getText().toString();
EditText email = (EditText)findViewById(R.id.email);
String email2 = email.getText().toString();
EditText password = (EditText)findViewById(R.id.password);
String password2 = password.getText().toString();
EditText vpassword = (EditText)findViewById(R.id.vpassword);
String vpassword2 = vpassword.getText().toString();
Toast.makeText(getApplicationContext(), "password 1 = " + password2, Toast.LENGTH_SHORT).show();
// if passwords match, send php url
if(vpassword2 == password2)
{
new RequestTask().execute("http://test");
}
else {
Toast.makeText(getApplicationContext(), "Passwords do not match!", Toast.LENGTH_SHORT).show();
}
}