体温填报app2.0开发
数据库的存储读取,系统时间读取。
Button Btn;
TextView timeET;
用户名与时间
User user=new User(); timeET=(TextView)findViewById( R.id.timeET ); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(" yyyy-MM-dd HH:mm"); Date date = new Date(System.currentTimeMillis()); timeET.setText(user.getName()+simpleDateFormat.format(date));
SQLiteDatabase sdb=dbHelper.getReadableDatabase(); String sql="select * from user where tel=?"; Cursor cursor=sdb.rawQuery(sql, new String[]{pho}); if(cursor.moveToFirst()==true) { User user=new User(); String name = cursor.getString(cursor.getColumnIndex("name")); user.setName(name); cursor.close(); return true; } return false;