当我的用户尝试加载页面时,我遇到了崩溃。该错误来自我的数据库中的查询。这个表是数据库的新增功能,但是当我自己加载应用程序时,无论我尝试什么,一切正常,我都没有遇到任何问题。他正在使用Kindle Fire fyi。这是堆栈跟踪。我不知道为什么会发生这种情况,除非我不管我做什么都无法重现错误。
这是查询
public HashMap<String, String> getimagelocation() {
HashMap<String, String> wordList = new HashMap<String, String>();
SQLiteDatabase database = this.getReadableDatabase();
String selectQuery = "SELECT * FROM LOGO";
Cursor cursor = database.rawQuery(selectQuery, null);
if (cursor.moveToFirst()) {
do {
//HashMap<String, String> map = new HashMap<String, String>();
wordList.put("imagetext", cursor.getString(1));
//wordList.add(map);
} while (cursor.moveToNext());
database.close();
}return wordList;
}
Stack Stack
java.lang.RuntimeException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2030)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2055)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1176)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4532)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException
at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:68)
at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:143)
at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361)
at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:127)
at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:94)
at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:53)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1566)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1540)
at com.superstore.st.Database.getimagelocation(Database.java:126)
at com.superstore.st.SuperStoreMenu.onCreateSuperStoreMenu(SuperStoreMenu.java:2955)
at com.superstore.st.SuperStoreMenu.onCreate(SuperStoreMenu.java)
at android.app.Activity.performCreate(Activity.java:4635)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1994)
... 11 more