android工具类---------(倒计时)

    class MyCount extends CountDownTimer {     
        public MyCount(long millisInFuture, long countDownInterval) {     
            super(millisInFuture, countDownInterval);     
        }     
        @Override     
        public void onFinish() {     
        	text.setText("finish");        
        }     
        @Override     
        public void onTick(long millisUntilFinished) {   
        	   int s=Integer.parseInt(""+millisUntilFinished / 1000);
               int N = s/3600;
               s = s%3600;
               int K = s/60;
               s = s%60;
               int M = s;
        	text.setText("剩余时间:"+N+": "+K+":"+M+"");     
        }    
    }
			mc = new MyCount(60*60*1000, 1000);  
		        mc.start();


你可能感兴趣的:(android工具类---------(倒计时))