Android SQLite Table not created

后端 未结 5 696
名媛妹妹
名媛妹妹 2021-01-23 18:12

I\'m trying to create a table of statistics but for some reason, it doesn\'t create until I call StatisticsAdapter.insertEntry() for the first time. After that, I c

5条回答
  •  忘掉有多难
    2021-01-23 18:32

    Create Class DatabaseHandler extends SQLiteOpenHelper

    and override like below:

    // Creating Tables
    @Override
    public void onCreate(SQLiteDatabase db) {
        String CREATE_CONTACTS_TABLE = Crate table query;
        db.execSQL(CREATE_CONTACTS_TABLE);
    }
    

    Now, you want to called SQLiteDatabase db = cintext.getWritableDatabase(); from your Activity for accessing Database table.

提交回复
热议问题