How to save input data of an Activity when going to another activity and send them in an email? [duplicate]

0

As you see in the image, my MainActivity is simple, with EditTexts that the user must complete, in the floating buttons, the check, fulfills a function that sends the email with the loaded data, that works well. Now, the floating button with add icon, would have to open the same screen with empty inputs, and by pressing the send button, the data loaded on the first screen and on the second screen should be sent in the email.

    
asked by 19.02.2018 в 02:19
source

1 answer

1

To pass data between activities you can use intents .

Intent intent = new Intent(this, SegundoActivity.class);
intent.putString("obra", obra.getText().toString();
.... //repites el proceso con todos los datos que quieras pasar al segundo activity
startIntent(intent) ;

In the second activity you pick them up

if (getIntent().getExtras=!null){
String obra = getIntent().getExtras.getString("obra")
.... Repites con el resto de datos que deseas recoger 
}

That's what I can understand what you need, if your need is another, you could explain us in a slightly clearer way, since I can understand your problem well. Remember that "work" would be a keyValue. I hope I have helped in something, as I tell you if your problem is different, you could detail us in a better way the problem.

Greetings

    
answered by 19.02.2018 / 09:52
source