冲刺第十天
今天是最后一天冲刺,大家总结了一下这此冲刺遇到的问题,找出自己的不足,将研发出的app导出apk,并在手机上运行测试
`package com.example.yibaifen;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.example.yibaifen.Bean.Student;
import com.example.yibaifen.Dao.StudentDao;
public class MyFragment extends Fragment {
// UI组件声明(如果有)
private EditText personalId, personalhuolizhi, personalyouxiang, personalPhone,personalzhiye;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 加载Fragment的布局
return inflater.inflate(R.layout.myfragment, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
personalId = view.findViewById(R.id.personal_id);
personalyouxiang = view.findViewById(R.id.personal_youxiang);
personalPhone = view.findViewById(R.id.personal_phone);
personalzhiye = view.findViewById(R.id.personal_zhiye);
//传入activity数据
Bundle args = getArguments();
String userdata = null;
if (args != null) {
userdata = args.getString("userdata");
}
String finalUserdata = userdata;
new Thread(new Runnable() {
@Override
public void run() {
personalId = view.findViewById(R.id.personal_id);
personalyouxiang = view.findViewById(R.id.personal_youxiang);
personalPhone = view.findViewById(R.id.personal_phone);
personalzhiye = view.findViewById(R.id.personal_zhiye);
StudentDao studentDao = new StudentDao();
Student s = studentDao.findStudent(finalUserdata);
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
personalId.setText("ID:"+s.getId());
personalyouxiang.setText("邮箱:"+s.getYouxiang());
personalPhone.setText("手机号:"+s.getPhone());
personalzhiye.setText("职业:"+s.getZhiye());
}
});
}
}).start();
}
}
`
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端