1
0
mirror of https://github.com/balkian/Carrousel-Android.git synced 2024-12-22 13:08:14 +00:00

I3: Tarea asincrona en el servicio

This commit is contained in:
Fernando Herrera 2011-03-09 23:01:20 +01:00
parent 699f7e153c
commit c45887f26e

View File

@ -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
}
}
}