Mauricio Ramos Mauricio Ramos - 1 year ago 51
Android Question

How to load information every minute in android?

I am making an app that shows the results of soccer matches live, I am making a request json format with the library volley and let me know if you can make that request every minute. Any method seemed to setInterval in javascript

Answer Source
private final static int INTERVAL = 1000 * 60 * 1;
Handler mHandler = new Handler();

Runnable mHandlerTask = new Runnable()
    public void run() {
         mHandler.postDelayed(mHandlerTask, INTERVAL);

call; whenever you want to start the task and replace doSomething() function with your volley request code.