当我尝试执行我的应用程序时,它崩溃了,我收到了这个"java.lang.RuntimeException: Unable to start activity ComponentInfo: Sqlite exception"
错误。请帮我找出我的错误。这是我的代码的快照:
@Override
public void onCreate(SQLiteDatabase db) {
this.db = db;
final String SQL_CREATE_QUESTIONS_TABLE =
"CREATE TABLE " +
questiontable.TABLE_NAME + " ( " +
questiontable._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
questiontable.COLUMN_QUESTION + "TEXT," +
questiontable.COLUMN_OPTION1 + " TEXT," +
questiontable.COLUMN_OPTION2 + " TEXT," +
questiontable.COLUMN_OPTION3 + " TEXT," +
questiontable.COLUMN_OPTION4 + " TEXT," +
questiontable.COLUMN_ANSWER_NR + "INTEGER" +
")";
db.execSQL(SQL_CREATE_QUESTIONS_TABLE);
fillquestionstable();
}'''
这是日志猫:
Process: com.example.modaltest, PID: 6534
java.lang.RuntimeException: Unable to startactivityComponentInfo{com.example.modaltest/com.example.modaltest.quiz}:android.database.sqlite.SQLiteException: near ".": syntax error (code 1): , while compiling: CREATE TABLE quiz_questions ( _id INTEGER PRIMARY KEY AUTOINCREMENT,com.example.modaltest.questionTEXT,option1 TEXT,option2 TEXT,option3 TEXT,option4 TEXT,answer_nrINTEGER)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)