在开始时一切正常,但是在我通过命令删除数据库之后:
this.deleteDatabase("databasename");
然后我的命令:
databasehelper.getWritableDatabase();
开始抛出异常
10-28 23:39:29.190: D/AndroidRuntime(15363): Shutting down VM
10-28 23:39:29.190: W/dalvikvm(15363): threadid=1: thread exiting with uncaught exception (group=0x40b5b300)
10-28 23:39:29.190: E/AndroidRuntime(15363): FATAL EXCEPTION: main
10-28 23:39:29.190: E/AndroidRuntime(15363): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.package/com.package.MainActivity}: java.lang.ArrayIndexOutOfBoundsException: length=50; index=50
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.ActivityThread.access$600(ActivityThread.java:130)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.os.Handler.dispatchMessage(Handler.java:99)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.os.Looper.loop(Looper.java:137)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-28 23:39:29.190: E/AndroidRuntime(15363): at java.lang.reflect.Method.invokeNative(Native Method)
10-28 23:39:29.190: E/AndroidRuntime(15363): at java.lang.reflect.Method.invoke(Method.java:511)
10-28 23:39:29.190: E/AndroidRuntime(15363): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-28 23:39:29.190: E/AndroidRuntime(15363): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-28 23:39:29.190: E/AndroidRuntime(15363): at dalvik.system.NativeStart.main(Native Method)
10-28 23:39:29.190: E/AndroidRuntime(15363): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=50; index=50
10-28 23:39:29.190: E/AndroidRuntime(15363): at com.package.DBHelper.onCreate(DBHelper.java:41)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
10-28 23:39:29.190: E/AndroidRuntime(15363): at com.package.MainActivity.onCreate(MainActivity.java:28)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.Activity.performCreate(Activity.java:5008)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
10-28 23:39:29.190: E/AndroidRuntime(15363): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
10-28 23:39:29.190: E/AndroidRuntime(15363): ... 11 more
我现在该怎么办?