0

我正在尝试使用fts4外部内容表创建一个虚拟表。该应用程序运行良好,API 23但当我运行它时API 16它崩溃了。

创建语句:

String DDL_FTS_TODO_TABLE = "CREATE VIRTUAL TABLE "+TBL_VIRTUAL_TODO+" USING fts4(content=\""+TBL_TODO+"\", "+
COL_TODO_TITLE +", "+COL_TODO_TITLE +", "+COL_TODO_DUE_DATE+"," +COL_TODO_ALARMDATE+","+ COL_TODO_REPEAT+", "+COL_TODO_LIST_ID+")";

我的日志猫:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity {com.example.recyclerviewtest/com.example.recyclerviewtest.HomeActivity}: 
android.database.sqlite.SQLiteException: vtable constructor failed: virtual_todo (code 1)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2596)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2624)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2101)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: vtable constructor failed: virtual_todo (code 1)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:738)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1675)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1602)
at com.example.recyclerviewtest.database.TodoOpenHelper.onCreate(TodoOpenHelper.java:32)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
at com.example.recyclerviewtest.database.TodoContentProvider.query(TodoContentProvider.java:52)
at android.content.ContentProvider.query(ContentProvider.java:652)
at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
at android.content.ContentResolver.query(ContentResolver.java:370)
at android.content.ContentResolver.query(ContentResolver.java:313)
at com.example.recyclerviewtest.database.TodoDbHelper.getAllLists(TodoDbHelper.java:123)
at com.example.recyclerviewtest.HomeActivity.onResume(HomeActivity.java:110)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1184)
at android.app.Activity.performResume(Activity.java:5082)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2586)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2624) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2101) 
at android.app.ActivityThread.access$600(ActivityThread.java:138) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:213) 
at android.app.ActivityThread.main(ActivityThread.java:4787) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556) 
at dalvik.system.NativeStart.main(Native Method) 
4

0 回答 0