打卡19
1.新学期目标2.打卡3.打卡24.打卡35.打卡 46.打卡57.打卡68.打卡79.打卡810.打卡911.打卡1012.结对作业(地铁查询项目)0113.结对作业(地铁项目)0214.结对作业(地铁项目)0315.结对作业(地铁项目)0416.结对作业(地铁项目)0517.结对作业(地铁项目)0618.结对作业(地铁项目)0719.结对作业(地铁项目)0820.结对作业(地铁项目)0921.结对作业(地铁项目)1022.结对作业(地铁项目)1123.结对作业(地铁项目)1224.结对作业(地铁项目)1325.结对作业(地铁项目)1426.五一冲刺(政策查询系统)127.五一冲刺(政策查询系统)228.政策查询系统(安卓)129.政策查询系统(安卓)230.政策查询系统(安卓)331.政策查询系统(安卓)432.政策查询系统(安卓)533.政策查询系统(安卓)634.政策查询系统(安卓)735.JS开发36.安卓app开发相关37.第一次个人作业(安卓学习记录系统)0138.第一次个人作业(安卓学习记录系统)0239.第一次个人作业(安卓学习记录系统)0340.第一次个人作业(安卓学习记录系统)0441.第一次个人作业(安卓学习记录系统)0542.第一次个人作业(安卓学习记录系统)0643.第一次个人作业(安卓学习记录系统)0744.打卡1145.打卡1246.打卡1347.打卡1448.打卡1549.打卡1650.打卡1751.打卡18
52.打卡19
53.打卡2054.python学习55.python学习256.python学习357.Javaweb58.打卡2159.fragment学习和使用60.mybits学习161.mybits学习262.mybits学习363.课程总结64.个人总结
所花时间(包括上课): |
2h |
代码量(行): |
150左右 |
搏客量(篇): |
1 |
了解到的知识点: |
安卓 |
备注(其他): |
package com.example.app_02;
import android.annotation.SuppressLint;
import android.app.DatePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import java.util.Calendar;
public class GoalActivity extends AppCompatActivity implements DatePickerDialog.OnDateSetListener, View.OnClickListener {
private DatePicker dp_date;
private EditText ed_goal;
private SharedPreferences sharedPreferences;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_goal);
dp_date=findViewById(R.id.dp_date);
ed_goal=findViewById(R.id.ed_goal);
findViewById(R.id.btn_save).setOnClickListener(this);
// 获取日历的一个实例,里面包含了当前的年月日
Calendar calendar = Calendar.getInstance();
DatePickerDialog dialog = new DatePickerDialog(this, this, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
// 显示日期对话框
dialog.show();
}
@Override
public void onDateSet(DatePicker datePicker, int year, int month, int dayOfMonth) {
sharedPreferences = getSharedPreferences("goal", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("goalDate", year + "-" + (month + 1) + "-" + dayOfMonth);
// editor.putString("goal", ed_goal.getText().toString());
editor.apply();
}
@Override
public void onClick(View view) {
sharedPreferences = getSharedPreferences("goal", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("goal", ed_goal.getText().toString());
editor.apply();
Intent intent = new Intent(this, FirstPageActivity.class);
startActivity(intent);
finish();
}
}
package com.example.app_02;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.app_02.entity.UserInfo;
import com.example.app_02.utils.UserDao;
import com.example.app_02.utils.UserInfoDao;
public class InfoActivity extends AppCompatActivity implements View.OnClickListener {
private EditText ed_studentid;
private EditText ed_name;
private EditText ed_phonenumber;
private EditText ed_class;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_info);
ed_studentid = findViewById(R.id.ed_studentid);
ed_name = findViewById(R.id.ed_name);
ed_phonenumber = findViewById(R.id.ed_phonenumber);
ed_class = findViewById(R.id.ed_class);
findViewById(R.id.btn_sure).setOnClickListener(this);
}
@Override
public void onClick(View view) {
// 获取输入框的值
String studentid = ed_studentid.getText().toString();
String name = ed_name.getText().toString();
String phonenumber = ed_phonenumber.getText().toString();
String className = ed_class.getText().toString();
UserInfo userInfo = new UserInfo(studentid, name, phonenumber, className);
new Thread(new Runnable() {
@Override
public void run() {
UserInfoDao userInfoDao = new UserInfoDao();
userInfoDao.insertUserInfo(userInfo);
Bundle bundle1 = getIntent().getExtras();
if(bundle1 != null) {
String username = bundle1.getString("username", "");
UserDao userDao = new UserDao();
userDao.updateUserStudentid(userInfo, username);
}
// Toast.makeText(InfoActivity.this, "登记成功", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(InfoActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}).start();
}
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效