Code example for ScheduledThreadPoolExecutor

Methods: scheduleAtFixedRate

0
				activity.toast(message);
			} 
		} 
 
		public void run() { 
			scheduledThreadPoolExecutor.scheduleAtFixedRate(pingTask, 0, pingInterval, TimeUnit.SECONDS);
			 
			Looper.prepare();
			 
			locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
			 
			// initialize from the activity, on the UI thread 
			activity.startLocation();
		} 
 
		public void setStatus(String status) {
			this.status = status;
			scheduledThreadPoolExecutor.execute(forcePingTask);
			if (status.equals(INACTIVE)) {
				Log.i(TAG, "Shutting down thread, service marked as inactive");
Stop searching for code, let great code find you!  Add Codota to your java IDE