Hi, I am using countdowntimer for 20sec.I need to display each second in textview. private void startCountDownTimer() { countDownTimer = new CountDownTimer(20000, 1000) {
public void onTick(long leftmiliseconds) { int zero = 0; this.leftmiliseconds = leftmiliseconds; int leftsecond = (int) leftmiliseconds / 1000; leftsecs = leftsecond; String secs = Integer.toString(leftsecond); if ((leftsecond) > 9) editremainingtime.setText("" + secs.substring(0, 1) + " " + secs.substring(1, 2)); else editremainingtime.setText("" + zero + " " + secs.substring(0, 1)); } public void onFinish() { stopCoutdown(); } }.start(); } My problem is that i have another button in my activity.when user clicks on that button i need to capture the left miliseconds.Rightnow i m getting the miliseconds from onTick method.which is not perfect because it gives the miliseconds at the time of tick. can anybody tell me what are the possible and best way to achieve this? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en