package jp.gihyo.mitoma.android.s010901basictrans;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import jp.gihyo.mitoma.android.s010901basictrans.extra.Activity_B;

public class Activity_A extends AppCompatActivity {
    EditText etValue;
    private static final String TAG = "Activity_A";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_a);
        etValue = findViewById(R.id.etValue);
        // ボタンへのクリックリスナーセット
        Button button = findViewById(R.id.button);
        button.setOnClickListener(new ButtonClick());
    }
    private class ButtonClick implements View.OnClickListener{
        public void onClick(View view){
            // Activity_Bに遷移
            String message = etValue.getText().toString();
            Intent intent = new Intent(getApplicationContext(), Activity_B.class);
            intent.putExtra("message",message);
            startActivity(intent);
        }
    }
}