package com.example.super_duckhunt;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Gender extends Activity implements OnClickListener {
EditText name;
TextView tv;
String x;
Start ob;
Button save,back,start;

	@Override
	
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.gender);
		name=(EditText)findViewById(R.id.editText1);
		save=(Button)findViewById(R.id.button1);
		start=(Button)findViewById(R.id.button2);
		back=(Button)findViewById(R.id.button3);
		ob=new Start();
		ob.music=false;
		tv=(TextView)findViewById(R.id.textView2);
		save.setOnClickListener(this);
		start.setOnClickListener(this);
		back.setOnClickListener(this);
	}
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	
	 if(v.equals(back)){
		Intent i=new Intent(Gender.this,Start.class);
		Gender.this.startActivity(i);
	}
		
	else if(v.equals(save)){
	 x=name.getText().toString();
		
	
		
		tv.setText("Hello "+name.getText().toString());
	 
	 start.setVisibility(View.VISIBLE);
	}else if(v.equals(start)){
		Intent i=new Intent("android.intent.action.START");
		i.putExtra("key",x);
		startActivity(i);
	}

	}}
