Cannot figure out how to create the cancel button for ringing alarm
问题 I am having trouble to stop the alarm from ringing even after I have pressed the stopAlarm button. I cannot figure out how to get access to the same Ringtone instance and call stop(). This is my start alarm switch in MainActivity java class. public void switchClicked(View view) { if (((Switch) view).isChecked()) { Log.d("MainActivity", "Alarm On"); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getHour()); calendar.set(Calendar.MINUTE,