今天完成了两个表连接数据库
package com.example.myapplication2; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.widget.Toast; public class DatabaseHelper extends SQLiteOpenHelper { public static final String CREATE_LIST="create table TTList3(" +"id integer primary key autoincrement," +"姓名 text," +"体温 text," +"日期时间 text," +"所在地 text," +"状况 text)"; private Context mContext; public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version){ super(context,name,factory,version); mContext=context; } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_LIST); Toast.makeText(mContext, "创建成功", Toast.LENGTH_SHORT).show(); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }