0
我有一个有趣的问题,我的手机上的代码运行良好,但是在模拟器上运行时,一旦应用程序试图从数据库获取值,就会发生崩溃。模拟器中的Android SQLite崩溃,但没有电话?
这里是一个崩溃它
/** Used to retrieve our lowest stored val */
public int GetLowestVal(){
// Get our databases results
Cursor result = null;
try {
// Get our databases results
result = super.getAll();
} catch(SQLException anyDbError) {
// Errors? TODO
} finally {
// Finally TODO
}
// Setup initial lowest val
int lowestVal = 0;
// Move through results and compare them
while(result.moveToNext()){
// Get our place from the DB
int index = Integer.parseInt(result.getString(1).trim());
// Last index should be lowest
if (index == 10){
lowestVal = Integer.parseInt(result.getString(3).trim());
}
}
// Return our value
return lowestVal;
}
的DB辅助功能,它抛出的错误是:
getWriteableDatabase()的递归调用。
请给我们一个完整的堆栈跟踪。 – 2011-02-03 01:17:54