Run a method every 5 minutes BuzzBox SDK

129 views Asked by At

I need to execute a method every 5 minutes. My problem is where? or How? could be to start the application but did not realize that. Any recommendations?

1

There are 1 answers

1
Eenvincible On BEST ANSWER

I don't know how BuzzBox works but I would create a Runnable, then call your method inside it every 5 minutes; That of course uses postDelayed method.

Handler handler = new Handler();
private Runnable updateTimerThread = new Runnable() {
    public void run() {
        //do call your method here; every 5 minutes
        customHandler.postDelayed(this, 5000);
    }

};

//you can use your handler anywhere you want like this

handler.postDelayed(updateTimerThread, 5000);