1
I have a code that transforms getText
in string
and would like to pass this string
to one other Activity in a simple way, but not an Activity that comes right after this.
My code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
editTextEmail = (EditText) findViewById(R.id.email);
editTextPassword = (EditText) findViewById(R.id.password);
buttonSignIn = (Button) findViewById(R.id.email_sign_in_button);
cadastro_button = (Button) findViewById(R.id.cadastro_button);
progressDialog = new ProgressDialog(this);
buttonSignIn.setOnClickListener(this);
cadastro_button.setOnClickListener(this);
buttonSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email = editTextEmail.getText().toString();
String password = editTextPassword.getText().toString();
attemptLogin(email, password);
}
});
}
Simple and fast ! Thank you very much !
– Samara Carvalho
@Samaracarvalho If the answer helped you you can mark it as correct using the V on its left side.
– Jéf Bueno
Leonardo, I tried to change the title of the question, but I’m not sure that’s it (since I know little about Android). Can you review it, please?
– Jéf Bueno
I changed there jbueno, thank you.
– Leonardo Dias
I have already given feedback that the answer was useful, but is not visible on account of my reputation..
– Samara Carvalho