这是我创建的功能。Playgolf 表有列 id、holepar、strokes、putts。我正在寻找总结笔画。
我已经编辑了代码,现在我收到了这个错误......有什么想法吗?
public void DisplaySum(int sum)
{
//Setup a local variable to store sum
int intRoundsSUM = 0;
db.open();
//Setup your database cursor
Cursor c = db.getPLAYGOLF();
Toast.makeText(getBaseContext(), intRoundsSUM, Toast.LENGTH_LONG).show();
//Iterate through the cursor
//Sum up each value
c.moveToFirst();
while(c.isAfterLast() == false) {
intRoundsSUM += c.getInt(2);
c.moveToNext();
}
Toast.makeText(getBaseContext(), intRoundsSUM, Toast.LENGTH_LONG).show();
}
// LOG CAT MAIN ERROR:
//E/AndroidRuntime(597): android.content.res.Resources$NotFoundException: String resource ID #0xa