Android SQLite Table not created

后端 未结 5 616
名媛妹妹
名媛妹妹 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:42

    try to extend SQLiteOpenHelper

    override

    @Override
      public void onCreate(SQLiteDatabase database) {
        database.execSQL(DATABASE_CREATE);
      }
    

    The database is not actually created or opened until one of getWritableDatabase() or getReadableDatabase() is called.

提交回复
热议问题