コードが電話で正常に実行されるという興味深い問題がありますが、エミュレーターで実行すると、アプリがデータベースから値を取得しようとするとすぐにクラッシュします。
これがクラッシュしているDB Helper関数です
/** 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;
}
そして、それがスローするエラーは次のとおりです。
getWriteableDatabase() が再帰的に呼び出されました。