4.23打卡
1.2.282.2.26打卡3.2.274.2.295.3.16.3.47.3.68.3.5开课作业9.3.710.3/8打卡11.3.1112.3.1213.3.1314.3.1415.3.1516.3.1817.3.1918.3.2019.3-21打卡20.3.2221.3.2522.3.2623.3-29打卡24.3月27打卡25.3.3126.4-1打卡27.4.228.4.329.4.430.4.531.4.832.4.933.4.1034.416打卡35.4.1736.4.1137.4.1238.4.1839.4.1940.4.22打卡
41.4.23打卡
42.4.24打卡43.4.25打卡44.4.26打卡45.4.2946.4.3047.5.148.5.249.5.350.57打卡51.5.852.5.953.5.1054.5.1355.5.1456.5.1557.5.1658.5.1759.5.2060.5.21打卡61.5.2262.5.2363.5.2464.5.2765.5.2866.529打卡67.5.30打卡68.5.31打卡69.6.3打卡70.6.4打卡71.6.5打卡72.6.6打卡73.6.7打卡74.6.10打卡75.6.13打卡76.6.14打卡77.6.15打卡78.6.16打卡79.第十六周总结80.6.17打卡81.6.19打卡82.6.20打卡83.6.21打卡84.6.23打卡85.6.24打卡86.6.25打卡87.6.26打卡88.6.27打卡89.6.28打卡90.6.29打卡91.6.30打卡92.6.1打卡93.6.294.第14周总结95.第十五周总结96.612打卡结对作业
• 所花时间:1
• 代码行数:487
• 博客容量:1
• 代码如下:
package com.example.subway;
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 MainActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.bt_all).setOnClickListener(this);
findViewById(R.id.bt_search).setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v.getId()== R.id.bt_all){
Intent intent=new Intent(this,getAll.class);
startActivity(intent);
} else if (v.getId()==R.id.bt_search) {
Intent intent=new Intent(this,searchLine.class);
startActivity(intent);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/black">
<TextView
android:layout_marginTop="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="地铁查询系统"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="30sp"
android:textColor="#ffffff"
android:layout_gravity="center"
android:layout_marginBottom="50dp"
/>
<Button
android:id="@+id/bt_all"
android:layout_width="230dp"
android:layout_height="70dp"
android:background="@drawable/my_button"
android:layout_gravity="center"
android:text="查看所有线路"
android:textSize="20sp"
android:textColor="@color/white"
android:layout_marginTop="50dp"
android:layout_marginBottom="50dp"
/>
<Button
android:textColor="@color/white"
android:id="@+id/bt_search"
android:layout_width="230dp"
android:layout_height="70dp"
android:background="@drawable/my_button"
android:layout_gravity="center"
android:text="查询路线"
android:textSize="20sp"
android:layout_marginTop="50dp"
/>
</LinearLayout>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)