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 和编程新手.. 建议我应该使用什么技术。
我的日志猫显示: 03-06 11:20:12.941: E/AndroidRuntime(2025): FATAL EXCEPTION: main 03-06 11:20:12.941: E/AndroidRuntime(2025): java.lang.RuntimeException: Unable to开始活动 ComponentInfo{com.example.habitator/com.example.habitator.AlarmDays}: android.database.CursorIndexOutOfBoundsException: 请求索引 -1,大小为 1