-2

In my Android application I have a button. After the button is clicked my already defined function should start running repeatedly for every 10 secs? Instead of clicking button and starting the task I might call this in OnCreate() also. Help me in this Please?

1 Answers1

0

Are you referring to something like this:

final Runnable r = new Runnable()
{
    public void run() 
    {
        myFunction();//the function to be executed
        handler.postDelayed(this, 10000);
    }
};

handler.postDelayed(r, 10000);

myFunction(){
}
Sweety Bertilla
  • 972
  • 10
  • 35