Code example for ScheduledThreadPoolExecutor

Methods: scheduleAtFixedRate

0
		return null; 
	} 
 
	@Override 
	public int onStartCommand(Intent intent, int flags, int startId) {
		ScheduledThreadPoolExecutor pool = new ScheduledThreadPoolExecutor(1);
		 
		System.out.println("Twitter service iniciou");
		pool.scheduleAtFixedRate(new TwitterTask(), 1, 1, TimeUnit.MINUTES);
 
		createTwitterNotification("Come�ou", "come�ou"); 
		 
		return START_STICKY;
	} 
 
	private boolean isConnected() { 
		ConnectivityManager connectivity = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
		NetworkInfo info = connectivity.getActiveNetworkInfo();
 
		return info.isConnected();
Contextual code suggestions in your IDE  Get Codota for Java