i am developing an app but i need run a function x minutes, i've tried using
scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleAtFixedRate(new Runnable() {
@Override public void run() {
Toast.makeText(ser, "Servicio MyService update", Toast.LENGTH_LONG).show();
}
},
0,
100,
TimeUnit.MILLISECONDS );
}
but it does not work. i use this function on a service, when the service is running it does'not call the function.