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.GridLayout;
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);


        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);
            }
        });
        GridLayout cards= (GridLayout)findViewById(R.id.cardLayout);
        for(int j =0;j<16;j++)
            cards.addView(new myCard(this,j));

    }
}
