package com.example.myapplication;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        Bundle bundle = getIntent().getExtras();
        if (bundle != null) {
            String name = bundle.getString("name");
            String age = bundle.getString("age");

            TextView tvName = findViewById(R.id.tvName);
            TextView tvAge = findViewById(R.id.tvAge);

            tvName.setText(name);
            tvAge.setText(age);
        }
    }
}
