Code example for ToggleButton

Methods: isCheckedtoggle

    timePicker.setOnTimeChangedListener(new OnTimeChangedListener() {
		public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
			if(real_time_button.isChecked()) {
   * Handles closing of dialog. If user intended to save the settings, selected 
   * hour and minute are stored in the preferences with keys KEY.hour and 
   * KEY.minute, where KEY is the preference's KEY. 
   * @param okToSave 
   * True if user wanted to save settings, false otherwise 
Contextual code suggestions in your IDE  Get Codota for Java