package jp.gihyo.mitoma.android.s0204001;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button = findViewById(R.id.button1);
        button.setTag("abc");
        button.setOnClickListener(new OnclickListener());
    }
    private class OnclickListener implements View.OnClickListener{
        public void onClick(View v){
            Toast.makeText(MainActivity.this,
                    "クラス処理 No="+(String)v.getTag(),Toast.LENGTH_LONG).show();
        }
    }
}