app/src/main/java/zeusro/specialalarmclock/activity/AlarmActivity.java
/**
     * Called when a view has been clicked.
     *
     * @param v The view that was clicked.
     */
Called when a view has been clicked.
@param v The view that was clicked.
Called when a view has been clicked . @param v The view that was clicked .
@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.CallAlarmServiceBroadcastReciever(alarm);
            if (checkBox.isChecked()) {
                Toast.makeText(AlarmActivity.this, alarm.getTimeUntilNextAlarmMessage(), Toast.LENGTH_LONG).show();
            }
        }
    }
@ 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 . CallAlarmServiceBroadcastReciever ( alarm ) ; if ( checkBox . isChecked ( ) ) { Toast . makeText ( AlarmActivity . this , alarm . getTimeUntilNextAlarmMessage ( ) , Toast . LENGTH_LONG ) . show ( ) ; } } }
Called when a view has been clicked.
Called when a view has been clicked .