2

On every app launch, I get time from server and store as a local string. I want that time to display in text like timer function. For example, I get server time 22:32:20, then textview display like timer(22:32:21 next 22:32:22 next 22:32:23 next.....). How do I increase time? I try to use countdown timer but its time decrease format like (22:32:20,22:32:19,22:32:18...). Note: not using device time. here 86400000 is the 24 hour converted into second

cdt = new CountDownTimer(86400000, 1000) {
    public void onTick(long millisUntilFinished) {

        long a=millisUntilFinished / 1000;
        long b=a/3600;//hour
        long c=a-b*3600;
        long d=c/60;//minutes
        long e=c-d*60;//seconds
        Log.e("c","Hour : "+b +"minutes : "+d +"seconds : "+e);
     }

     public void onFinish() {
         //   timer.setText("done!");
     }
 };
 cdt.start();
ZachB
  • 13,051
  • 4
  • 61
  • 89
krish
  • 21
  • 3

0 Answers0