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
例外を取得します!! 私はアンドロイドとプログラミングが初めてです..使用すべきテクニックを教えてください。
私のログ猫は次のように示しています: 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 start activity ComponentInfo{com.example.habitator/com.example.habitator.AlarmDays}: android.database.CursorIndexOutOfBoundsException: インデックス -1 が要求され、サイズは 1 です