查看所有体温录入情况直接向数据库查询当前的体温录入情况
package com.example.tiwen20;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import androidx.appcompat.app.AppCompatActivity;
public class alltiwenActivity extends AppCompatActivity {
private ListView listView;
private TiwenAdapter tiwenAdapter;
private Cursor cursor;
private TiwenDB tiwenDB;
private Log log;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alltiwen);
listView = (ListView)findViewById(R.id.lv_addtiwen);
tiwenDB = new TiwenDB(this);
cursor = tiwenDB.getAlltiwenData();
tiwenAdapter = new TiwenAdapter(this,cursor);
listView.setAdapter(tiwenAdapter);
log.v("mylog","这是我的调试信息--------------------------------------------------------");
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tv_addlisttime"
android:layout_weight="8"
android:text="日期"
android:gravity="center"
android:textColor="#000000"
>
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_addlisttiwen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="体温"
android:gravity="center"
android:textColor="#000000"></TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tv_addlistname"
android:gravity="center"
android:text="姓名"
android:layout_weight="1"
android:textColor="#000000">
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tv_addlistqingkuang"
android:gravity="center"
android:text="特殊情况"
android:layout_weight="1"
android:textColor="#000000">
</TextView>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="地点"
android:gravity="center"
android:id="@+id/tv_addlistdidian"
android:textColor="#000000"
android:layout_weight="1">
</TextView>
</LinearLayout>
</LinearLayout>
<ListView
android:layout_width