mirror of
				https://github.com/balkian/Carrousel-Android.git
				synced 2025-11-04 01:28:17 +00:00 
			
		
		
		
	I3: Tarea asincrona en el servicio
This commit is contained in:
		@@ -1,5 +1,8 @@
 | 
			
		||||
package com.onirica.carrousel;
 | 
			
		||||
 | 
			
		||||
import java.util.Timer;
 | 
			
		||||
import java.util.TimerTask;
 | 
			
		||||
 | 
			
		||||
import android.app.Service;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.os.IBinder;
 | 
			
		||||
@@ -11,5 +14,18 @@ public class Results extends Service {
 | 
			
		||||
		// TODO Auto-generated method stub
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onCreate() {
 | 
			
		||||
         pollingTask task = new pollingTask();
 | 
			
		||||
         Timer timer = new Timer(true);
 | 
			
		||||
         timer.scheduleAtFixedRate(task, 0, 60000);
 | 
			
		||||
  }
 | 
			
		||||
	
 | 
			
		||||
	private class pollingTask extends TimerTask {
 | 
			
		||||
		  @Override
 | 
			
		||||
		  public void run() {
 | 
			
		||||
		  // Aqui descargaremos los resultados
 | 
			
		||||
		  }
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user