I have a return date(somewhere in near furture) stored within the application.
Now i need a find out current time of the android phone , then i can find out the amount of mins hours to countdown from . the below is what i have at the moment, when i create the below object i pass it PinnedCountdownTimer pct = new PinnedCountdownTimer((getTimeToReturn().getTime()-System.currentTimeMillis()),1000,countdownTv);
public class PinnedCountdownTimer extends CountDownTimer {
TextView tv;
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
Date resultdate ;
public PinnedCountdownTimer(long millisInFuture, long countDownInterval,TextView tv) {
super(millisInFuture, countDownInterval);
this.tv = tv;
}
@Override
public void onFinish() {
tv.setText("get back to your car!");
}
@Override
public void onTick(long millisUntilFinished) {
resultdate = new Date(millisUntilFinished);
tv.setText("Left: " + sdf.format(resultdate) );
}
}
this does not work correctly.....do you guys have any idea?