package jp.gihyo.mitoma.android.s1902scrollstep01;

import androidx.appcompat.app.AppCompatActivity;

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

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button1 = findViewById(R.id.button01);
        Button button2 = findViewById(R.id.button02);
        button1.setOnClickListener(new ButtonClick1());
        button2.setOnClickListener(new ButtonClick2());
    }
    private class ButtonClick1 implements View.OnClickListener{
        public void onClick(View view){
            Intent intent =
                    new Intent(getApplicationContext(), SubActivity1.class);
            startActivity(intent);
        }
    }
    private class ButtonClick2 implements View.OnClickListener{
        public void onClick(View view){
            Intent intent =
                    new Intent(getApplicationContext(), SubActivity2.class);
            startActivity(intent);
        }
    }
}