安卓开发

开始做建民老师的体温开发app:

1.数据库操作:

private void savedb(String name, String num, String cl,String date, String time, String area, String tem,String qw) {
UserDao userDao = UserDao.getInstance(getApplicationContext());
User user = new User(name,num,cl, date, time, area, tem,qw);
userDao.insert(user);
}//存储
public void initcharacter(int t){
int i=0;
UserDao2 userDao=UserDao2.getInstance(getApplicationContext());
List<User2> userList=userDao.findAll();
if (userDao.pkong()==true) {
for(User2 u:userList){
if(i==t){
editText5.setText(u.getNum());
editText0.setText(u.getName());
editText6.setText(u.getCl());
break;}
else{
i++;
}
}
}
}//遍历
posted @ 2021-03-05 11:00  平安喜乐v  阅读(33)  评论(0编辑  收藏  举报