package com.example.sadievrenseker.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;

public class GameActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_game);
        Intent i = getIntent();
        String userName = i.getStringExtra("myMessage");
        int age = i.getIntExtra("Age",1);
        TextView tv = (TextView) findViewById(R.id.textView2);
        CheckBox cb = (CheckBox) findViewById(R.id.checkBox) ;
        if(cb.isChecked()){

        }
        tv.setText("Welcome " + userName+ "\nAge:"+ age);
        ((Button)findViewById(R.id.button2)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(GameActivity.this, MainActivity.class);

                startActivity(i);
            }
        });
    }
}
