package com.example.ourhomework1.activities;标签:12.29,Intent,import,android,btn,intent,id From: https://www.cnblogs.com/yang-----/p/18658673
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.example.ourhomework1.MainActivity;
import com.example.ourhomework1.R;
import com.example.ourhomework1.dao.UserDao;
public class teacherActivity extends AppCompatActivity implements View.OnClickListener {
private Button btn_allRecords, btn_dailyRecord, btn_allInformation;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_teacher);
btn_allRecords = findViewById(R.id.btn_allRecords);
btn_dailyRecord = findViewById(R.id.btn_dailyRecord);
btn_allInformation = findViewById(R.id.btn_allInformation);
btn_allRecords.setOnClickListener(this);
btn_dailyRecord.setOnClickListener(this);
btn_allInformation.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_allRecords) {
Intent intent = new Intent(teacherActivity.this, tAllRecordsActivity.class);
startActivity(intent);
} else if (v.getId() == R.id.btn_dailyRecord) {
Intent intent = new Intent(teacherActivity.this, tDailyRecordActivity.class);
startActivity(intent);
} else if (v.getId() == R.id.btn_allInformation) {
Intent intent = new Intent(teacherActivity.this, tAllInformationActivity.class);
startActivity(intent);
}
}
}