主页面也上次体温填报页面类似,在百度接口,时间获取上
主页面相关代码
time1= (TextView) findViewById(R.id.tv_time1);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");// HH:mm:ss
//获取当前时间
Date date = new Date(System.currentTimeMillis());
time1.setText("Date获取当前日期时间"+simpleDateFormat.format(date));
//time1= (TextView) findViewById(R.id.tv_time1);
mbutt=findViewById(R.id.butt_1);
mbutt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this,Text.class);
startActivity(intent);
}
});
Intent intent=getIntent();
String phone=intent.getStringExtra("phone");
name=findViewById(R.id.name_1);
banji=findViewById(R.id.banji);
userDao=new UserDao(this);
User user = userDao.login1(phone);
String name1=user.getName();
String banji1=user.getBanji();
name.setText(name1);
banji.setText(banji1);