tags:

views:

29

answers:

1

dear friends,

i want to call a function "ABC" after 10 seconds in android again and again untill i use return statement to quit.

any one guide me how to achieve this?

+2  A: 

Use CountDownTimer

 CountDownTimer t = new CountDownTimer( Long.MAX_VALUE , 1000) {

        public void onTick(long millisUntilFinished) {
            Log.d("test","Timer tick");
        }

        public void onFinish() {
            Log.d("test","Timer last tick");            
            t.start();
        }
     }.start();
Orsol
but it is fixed i want to make unlimited calls after each 10 seconds then?
UMMA
Just cancel the timer when you are done.
alexanderblom