Code example for SwitchPreference

Methods: isChecked

0
					Toast.makeText(getActivity(), "Service OFF", Toast.LENGTH_SHORT).show();
				//	catTaskService.removePreference(lInterval); 
					alarmManager.cancel(pendingIntent);
				} 
			} else if (preference == lInterval) {
				if (swchFetch.isChecked()) {
					long startTime = 0;
					if (newValue.equals("86400")) {
						Calendar midnight = Calendar.getInstance();
						midnight.set(Calendar.HOUR_OF_DAY, 0);
						midnight.set(Calendar.MINUTE, 0);
						midnight.set(Calendar.SECOND, 0);
						midnight.add(Calendar.DAY_OF_MONTH, 1);
						startTime = midnight.getTimeInMillis();
						toastText = "Every 24 Hours at 00:00";
					} else if (newValue.equals("10")) {
						toastText = "Every 10 Seconds starting Now";
					} else if (newValue.equals("60")) {
						toastText = "Every Minute starting Now";
					} else if (newValue.equals("900")) {
Connect your IDE to all the code out there  Get Codota for Java