package study.sol.check1;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.Toast;

public class CheckEx1Activity extends Activity implements OnClickListener {
	/** Called when the activity is first created. */

	CheckBox cb1, cb2, cb3;
	Button bt;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		cb1 = (CheckBox) findViewById(R.id.checkBox1);
		cb2 = (CheckBox) findViewById(R.id.checkBox2);
		cb3 = (CheckBox) findViewById(R.id.checkBox3);
		bt = (Button) findViewById(R.id.button1);

		bt.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub

		String result = "";

		if (v.getId() == R.id.button1) {
			// (5)어떤 버튼이 눌러 졌는지 판별

			if (cb1.isChecked()) {
				result += "축구,";
			}
			if (cb2.isChecked()) {
				result += "농구,";
			}
			if (cb3.isChecked()) {
				;
				result += "야구,";
			}

			result += "을 선택 했읍니다";
		}
		// Toast.makeText(this, result, Toast.LENGTH_SHORT).show();
		Toast.makeText(this, result, Toast.LENGTH_SHORT).show();
	}

	/** 개발자가 직접 정의하는 모듈 */


	}
}