public List<String> getDays(long iid)
{
List<String> days= new ArrayList<String>();
cursor = database.query(MySqliteHelper.TABLE_REPEAT, daysColumn, MySqliteHelper.COLUMN_TID + "=" + iid, null, null, null, null);
while(fg>=1)
{
cursor = database.query(MySqliteHelper.TABLE_REPEAT, daysColumn, MySqliteHelper.COLUMN_TID + "=" + iid, null, null, null, null);
String day = cursor.getString(cursor.getColumnIndex(MySqliteHelper.COLUMN_DAYS));
days.add(day);
cursor.moveToNext();
if(cursor.isAfterLast())
{
fg=0;
}
}
cursor.close();
fg=1;
return days;
}
现在我得到arrayindexoutofbound
异常!我是新来的Android和编程.. 建议我使用什么技术。从表中取多个值
和我的日志猫显示: 11月3日至6日:20:12.941:E/AndroidRuntime(2025):致命异常:主要 11月3日至6日:20:12.941:E/AndroidRuntime(2025):JAVA。 lang.RuntimeException:无法启动活动ComponentInfo {com.example.habitator/com.example.habitator.AlarmDays}:android.database.CursorIndexOutOfBoundsException:请求索引-1,大小为1
亲爱的,你确切地知道'光标'是什么?以上代码你在做什么? – 2013-03-06 10:31:49
我编辑了我的问题。请检查 – AnRu 2013-03-06 10:52:34