I have two editText
that I enter with an in and a compute button. I would like to present the result in a second activity as soon as I pressed the calculate button. Could someone help me with this?
I have two editText
that I enter with an in and a compute button. I would like to present the result in a second activity as soon as I pressed the calculate button. Could someone help me with this?
The basic model for passing information between Acitivities is this, according to android documentation :
Intent intent = new Intent(this, OutraActivity.class);
EditText editText = (EditText) findViewById(R.id.meuEditText);
String message = editText.getText().toString();
intent.putExtra("mensagem", message);
startActivity(intent);
And to get the OutraActivity.class
:
Intent intent = getIntent();
String message = intent.getStringExtra("mensagem");
There are more examples in the documentation, enjoy and check it out, it is in English but it is very ditático.
Study references:
How do I pass parameters from the last Fragment to the previous Fragment?