@Override public void onClick(View v) { if (v.getId() == R.id.checkBox_alarm_active) { CheckBox checkBox = (CheckBox) v; Alarm alarm = (Alarm) alarmListAdapter.getItem((Integer) checkBox.getTag()); alarm.setAlarmActive(checkBox.isChecked()); Database.update(alarm); AlarmActivity.this.callMathAlarmScheduleService(); if (checkBox.isChecked()) { Toast.makeText(AlarmActivity.this, alarm.getTimeUntilNextAlarmMessage(), Toast.LENGTH_LONG) .show(); } } }