目的实现:通过之前的textview输入,将其记录下来,并可以作为之后的输入提示来用。
1、实现数据库,将输入的数据存入数据库中
DBhelper
public class DBhelper extends SQLiteOpenHelper{
String CREATE_IUPUTE = "create table Input("
+"input text)";
public DBhelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_IUPUTE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
DB
public class DB {
private static DB mydb;
private SQLiteDatabase db;
public DB(Context context) {
DBhelper dBhelper = new DBhelper(context,"Input",