安卓开发日记61

所学时间:2小时

代码行数:110

博客园数:1篇

所学知识:继续代码的完成

package com.example.myexamproject;



import androidx.appcompat.app.AppCompatActivity;

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

import com.example.myexamproject.R;

public class BackActivity extends AppCompatActivity implements View.OnClickListener {

private Button bt_backfalse;
private Button bt_backtrue;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_back);

bt_backfalse = findViewById(R.id.bt_backfalse);
bt_backfalse.setOnClickListener(this);

bt_backtrue = findViewById(R.id.bt_backtrue);
bt_backtrue.setOnClickListener(this);

}

@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.bt_backfalse:
Intent intent_insert = new Intent();
intent_insert.setClass(BackActivity.this, PersonalCenterActivity.class);
startActivity(intent_insert);
break;

case R.id.bt_backtrue:
Intent intent_query = new Intent();
intent_query.setClass(BackActivity.this, LoginActivity.class);
startActivity(intent_query);
break;

}
}
}

 

posted @ 2024-06-14 20:46  大虚胖子  阅读(3)  评论(0编辑  收藏  举报