今日总结
代码如下
package com.app.chapter04;标签:finish,androidx,6.11,Intent,import,android,id From: https://www.cnblogs.com/tianpeisen/p/18250933
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class ActFinishActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_act_finish);
findViewById(R.id.iv_back).setOnClickListener(this);
findViewById(R.id.btn_finish).setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v.getId() == R.id.iv_back || v.getId() == R.id.btn_finish){
//结束当前页面
//finish();
//跳转到ActStartActivity界面
Intent intent = new Intent(this, ActStartActivity.class);
startActivity(intent);
}
}
}