/*
 * Copyright (c) 2016. 소프트웨어
 */

package com.example.comcx.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.Toast;
import android.widget.ToggleButton;

/**
 * Created by comcx on 2016-06-23.
 */
public class Example010 extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_010);

        final ToggleButton tb = (ToggleButton)findViewById(R.id.ToggleButton);
        final Switch sw = (Switch)findViewById(R.id.Switch);

        tb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Toast.makeText(Example010.this, getString(R.string.example010), Toast.LENGTH_SHORT).show();
            }
        });

        sw.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Toast.makeText(Example010.this, getString(R.string.example010), Toast.LENGTH_SHORT).show();
            }
        });
    }
}
