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?
Asked
Active
Viewed 23 times
-2
-
Can you post your code? – Blue Ice Mar 05 '14 at 19:49
-
Check this one http://stackoverflow.com/questions/6242268/repeat-a-task-with-a-time-delay – barisemreefe Mar 05 '14 at 19:52
1 Answers
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