3.24总结

package com.example.myapplication;

import static android.view.View.*;
import static com.example.myapplication.R.*;


import androidx.appcompat.app.AppCompatActivity;

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

import com.example.myapplication.R.id;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(layout.activity_main);
TextView tv = findViewById(id.tv);
tv.setTextSize(30);
tv.setTextColor(Color.MAGENTA);
tv.setText("你好,希儿");

Button button = findViewById(id.button);
Button button1 = findViewById(id.button1);
button.setTextColor(0xff00ff00);
button.setBackgroundColor(Color.YELLOW);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(MainActivity.this, MainActivity2.class);
startActivity(intent);
}
});
button1.setTextColor(0xff00ff00);
button1.setBackgroundColor(Color.GREEN);
button1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v1) {
Intent intent = new Intent();
intent.setClass(MainActivity.this, Mainphoto1.class);
startActivity(intent);
}
});


}
}

 

 

 

 

 

 

 

posted @   奉禾  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
点击右上角即可分享
微信分享提示
主题色彩