[嘿,我有一个倒数计时器,用来向用户显示我的应用程序还剩多少时间。但是现在我想如果计时器运行1分钟,并且用户在30秒后关闭应用程序,然后在接下来的5秒内用户再次打开应用程序,那么时间应该从剩余的25秒开始运行]]
CountDownAdapter countDown = new CountDownAdapter(60*1000, 1000);
countDown.setSourceActivity(MainActivity.this);
countDown.start();
public void onCountDownTimer(long millisUntilFinished)
{
secondsLefts = millisUntilFinished;
long secondsLeft = millisUntilFinished / 1000;
long hours = secondsLeft / 3600;
long minutes = (secondsLeft % 3600) / 60;
long seconds = secondsLeft % 60;
timerText = hours + "h: "+minutes + "m: "+seconds + "s";
if(timerText.equals("0h: 0m: 1s"))
{
}
timer.setText(timerText);
}
[嘿,我有一个倒数计时器,用来向用户显示我的应用程序还剩多少时间。但是现在我想如果计时器运行1分钟,并且用户在30秒后以及接下来的5秒内关闭应用程序...