I have an activity and a PopUp window that comes up when I click on a button, this window has a button, which detects your click from the class of the window, what the button does is pass some data to the main activity and close the popup with the method finish (); Until then, the problem is that I do not know how to receive the data in the main activity. I need the data (which are Strings) that the popup sends to be received by the main activity (once the popup window is closed) and they are passed to a TextView of that activity, all automatically.
PS: When I do the Intent on the PopClick onClick, I do not use the startActivity (intent); because in that way the main activity is restarted, which is why I only give it finish (); PopUp and it closes.
OnClick of the PopUp button:
public void guardar2(View view){
Intent intent= new Intent (this, Activity1.class);
intent.putExtra("asunto",edit_asunto.getText());
intent.putExtra("usuario",edit_usuario.getText());
intent.putExtra("contra",edit_contra.getText());
intent.putExtra("id",ID);
finish();
}
I do not know what method to use for Activity1 to receive the data and store it in a TextView (All automatically without needing to touch another button).