How do I display the text entered in a TextView after clicking a button in Android Studio?

So I am experimenting with Android Studio. I am stuck in the part where I want my "Submit" button to display the user inputted text underneath the page.

Button submit is the button. "name" and "email" are the EditText variables a.k.a text fields My TextView variable is outputText

So after the user enters random stuff in both text fields and click submit, I want my outputText to display both texts that were inputted in 2 separate lines

ex:

John Smith

[email protected]

The code below is my .java code for the activity. I need to know how to initialize the new intent in a way that lets me do the 4 lines below it. Thanks.

public void buttonOnClick(View v){
    Button submit = (Button) v;

    submit.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Intent i =
                    new Intent(...?...);
            startActivity(i);
        }
    });
    editName = (EditText) findViewById(R.id.name);
    editEmail = (EditText) findViewById(R.id.email);

    textout = (TextView) findViewById(R.id.textView);
    textout.setText(editName.getText()+" "+editEmail.getText());

}


I want my outputText to display both texts that were inputted in 2 separate lines

Use <br> and Html.fromHtml between text to add new line:

String strText=(String)editName.getText()+"<br>"+(String)editEmail.getText();
textout.setText(Html.fromHtml(strText));

how to initialize the new intent in a way that lets me do the 4 lines below it...

Intent i =new Intent(CurrentActivityName.this,TargetActivityName.class);
startActivity(i);