android.os.CountDownTimer Java Examples

The following examples show how to use android.os.CountDownTimer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From andOTP with MIT License 6 votes vote down vote up
private boolean setCountDownTimerNow() {
    int secondsToBlackout = 1000 * settings.getAuthInactivityDelay();

    if (settings.getAuthMethod() == AuthMethod.NONE || !settings.getAuthInactivity() || secondsToBlackout == 0)
        return false;

    countDownTimer = new CountDownTimer(secondsToBlackout, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
        }

        @Override
        public void onFinish() {
            authenticate(R.string.auth_msg_authenticate);
            this.cancel();
        }
    };

    return true;
}
 
Example #2
Source File: AdvertisementActivity.java    From LinkedME-Android-Deep-Linking-Demo with GNU General Public License v3.0 6 votes vote down vote up
private void startCountDownTime(long time) {
    timer = new CountDownTimer(time * 1000, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            //每隔countDownInterval秒会回调一次onTick()方法
            down_timer.setText(String.format(getString(R.string.count_down_str), millisUntilFinished / 1000));
        }

        @Override
        public void onFinish() {
            // TODO: 27/02/2017 广告演示:广告展示完毕需要调用该方法执行深度链接跳转
            closeActivity();
        }

    };
    timer.start();// 开始计时
}
 
Example #3
Source File: WelcomeActivity.java    From input-samples with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.welcome_activity);
    final TextView countdownText = findViewById(R.id.countdownText);
    new CountDownTimer(5000, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            int secondsRemaining = toIntExact(millisUntilFinished / 1000);
            countdownText.setText(getResources().getQuantityString
                    (R.plurals.welcome_page_countdown, secondsRemaining, secondsRemaining));
        }

        @Override
        public void onFinish() {
            if (!WelcomeActivity.this.isFinishing()) {
                finish();
            }
        }
    }.start();
}
 
Example #4
Source File: CircledImageViewPreference.java    From wear-os-samples with Apache License 2.0 6 votes vote down vote up
public void setLoadingCircledImageView() {
    mCircledImageText.setText(R.string.loading);
    mCircledImage.setImageResource(R.drawable.stop);
    mCircledImage.setCircleBorderColor(mColorAccent);
    mCountDownTimer =
            new CountDownTimer(10000, 10) {
                @Override
                public void onTick(long millisUntilFinished) {
                    float timeElapsed = (10000.0f - millisUntilFinished) / 10000.0f;
                    mCircledImage.setProgress(timeElapsed);
                }

                @Override
                public void onFinish() {
                    setStartCircledImageView();
                }
            }.start();
}
 
Example #5
Source File: ObjectConfirmationController.java    From mlkit-material-android with Apache License 2.0 6 votes vote down vote up
/**
 * @param graphicOverlay Used to refresh camera overlay when the confirmation progress updates.
 */
ObjectConfirmationController(GraphicOverlay graphicOverlay) {
  long confirmationTimeMs = PreferenceUtils.getConfirmationTimeMs(graphicOverlay.getContext());
  countDownTimer =
      new CountDownTimer(confirmationTimeMs, /* countDownInterval= */ 20) {
        @Override
        public void onTick(long millisUntilFinished) {
          progress = (float) (confirmationTimeMs - millisUntilFinished) / confirmationTimeMs;
          graphicOverlay.invalidate();
        }

        @Override
        public void onFinish() {
          progress = 1;
        }
      };
}
 
Example #6
Source File: FindPwdStep2Activity.java    From imsdk-android with MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.atom_ui_activity_find_pwd_step2);

    domainId = getIntent().getStringExtra(Constants.BundleKey.RESULT_DOMAIN_ID);
    QtNewActionBar actionBar = (QtNewActionBar) this.findViewById(R.id.my_action_bar);
    setNewActionBar(actionBar);
    setActionBarTitle(R.string.atom_ui_forget_pwd);

    timer = new CountDownTimer(millisInFuture,1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            atom_ui_get_sms_code.setText(countTimes-- + "s");
        }

        @Override
        public void onFinish() {
            atom_ui_get_sms_code.setText(R.string.atom_ui_get_verify_code);
            atom_ui_get_sms_code.setClickable(true);
        }
    };

    initView();
    showPicCode();
}
 
Example #7
Source File: KToast.java    From KToast with Apache License 2.0 6 votes vote down vote up
/**
 * Error type toast.
 * @param activity
 * @param message
 * @param gravity
 * @param duration
 */
public static void errorToast(final Activity activity, String message, final int gravity, int duration){
    final View view = (activity.getLayoutInflater().inflate(R.layout.layout_error_toast, null));

    ((TextView)view.findViewById(R.id.txtErrorToast)).setText(message);

    if (duration == LENGTH_AUTO){
        duration = Util.toastTime(message);
    }

    new CountDownTimer(Math.max(duration+1000, 1000), 2000){
        @Override
        public void onFinish() {

        }

        @Override
        public void onTick(long millisUntilFinished) {
            Toast toast = new Toast(activity);
            toast.setGravity(gravity, 0, 0);
            toast.setDuration(Toast.LENGTH_SHORT);
            toast.setView(view);
            toast.show();
        }
    }.start();
}
 
Example #8
Source File: KToast.java    From KToast with Apache License 2.0 6 votes vote down vote up
/**
 * Warning type toast.
 * @param activity
 * @param message
 * @param gravity
 * @param duration
 */
public static void warningToast(final Activity activity, String message, final int gravity, int duration){
    final View view = (activity.getLayoutInflater().inflate(R.layout.layout_warning_toast, null));

    ((TextView)view.findViewById(R.id.txtWarningToast)).setText(message);

    if (duration == LENGTH_AUTO){
        duration = Util.toastTime(message);
    }

    new CountDownTimer(Math.max(duration+1000, 1000), 2000){
        @Override
        public void onFinish() {

        }

        @Override
        public void onTick(long millisUntilFinished) {
            Toast toast = new Toast(activity);
            toast.setGravity(gravity, 0, 0);
            toast.setDuration(Toast.LENGTH_SHORT);
            toast.setView(view);
            toast.show();
        }
    }.start();
}
 
Example #9
Source File: KToast.java    From KToast with Apache License 2.0 6 votes vote down vote up
/**
 * Info type toast.
 * @param activity
 * @param message
 * @param gravity
 * @param duration
 */
public static void infoToast(final Activity activity, String message, final int gravity, int duration){
    final View view = (activity.getLayoutInflater().inflate(R.layout.layout_info_toast, null));

    ((TextView)view.findViewById(R.id.txtInfoToast)).setText(message);

    if (duration == LENGTH_AUTO){
        duration = Util.toastTime(message);
    }

    new CountDownTimer(Math.max(duration+1000, 1000), 2000){
        @Override
        public void onFinish() {

        }

        @Override
        public void onTick(long millisUntilFinished) {
            Toast toast = new Toast(activity);
            toast.setGravity(gravity, 0, 0);
            toast.setDuration(Toast.LENGTH_SHORT);
            toast.setView(view);
            toast.show();
        }
    }.start();
}
 
Example #10
Source File: KToast.java    From KToast with Apache License 2.0 6 votes vote down vote up
/**
 * Success type toast.
 * @param activity
 * @param message
 * @param gravity
 * @param duration
 */
public static void successToast(final Activity activity, String message, final int gravity, int duration){
    final View view = (activity.getLayoutInflater().inflate(R.layout.layout_success_toast, null));

    ((TextView)view.findViewById(R.id.txtSuccessToast)).setText(message);

    if (duration == LENGTH_AUTO){
        duration = Util.toastTime(message);
    }

    new CountDownTimer(Math.max(duration+1000, 1000), 2000){
        @Override
        public void onFinish() {

        }

        @Override
        public void onTick(long millisUntilFinished) {
            Toast toast = new Toast(activity);
            toast.setGravity(gravity, 0, 0);
            toast.setDuration(Toast.LENGTH_SHORT);
            toast.setView(view);
            toast.show();
        }
    }.start();
}
 
Example #11
Source File: KToast.java    From KToast with Apache License 2.0 6 votes vote down vote up
/**
 * Normal type toast.
 * @param activity
 * @param message
 * @param gravity
 * @param duration
 */
public static void normalToast(final Activity activity, String message, final int gravity, int duration){
    final View view = (activity.getLayoutInflater().inflate(R.layout.layout_normal_toast, null));

    ((TextView)view.findViewById(R.id.txtNormalToast)).setText(message);

    if (duration == LENGTH_AUTO){
        duration = Util.toastTime(message);
    }

    new CountDownTimer(Math.max(duration+1000, 1000), 2000){
        @Override
        public void onFinish() {

        }

        @Override
        public void onTick(long millisUntilFinished) {
            Toast toast = new Toast(activity);
            toast.setGravity(gravity, 0, 0);
            toast.setDuration(Toast.LENGTH_SHORT);
            toast.setView(view);
            toast.show();
        }
    }.start();
}
 
Example #12
Source File: Reg.java    From stynico with MIT License 6 votes vote down vote up
@Override
  public int onStartCommand(Intent intent, int flags, int startId) {

// 第一个参数是总时间, 第二个参数是间隔
      mCodeTimer = new CountDownTimer(129000, 1000) {
          @Override
          public void onTick(long millisUntilFinished) {
		// 广播剩余时间
              broadcastUpdate(IN_RUNNING, millisUntilFinished / 1000 + "");
          }

          @Override
          public void onFinish() {
		// 广播倒计时结束
              broadcastUpdate(END_RUNNING);
              // 停止服务
              stopSelf();
          }
      };
// 开始倒计时
      mCodeTimer.start();
      return super.onStartCommand(intent, flags, startId);
  }
 
Example #13
Source File: msf_shell.java    From stynico with MIT License 6 votes vote down vote up
@Override
  public int onStartCommand(Intent intent, int flags, int startId) {

// 第一个参数是总时间, 第二个参数是间隔
      mCodeTimer = new CountDownTimer(60000, 1000) {
          @Override
          public void onTick(long millisUntilFinished) {
		// 广播剩余时间
              broadcastUpdate(IN_RUNNING, millisUntilFinished / 1000 + "");
          }

          @Override
          public void onFinish() {
		// 广播倒计时结束
              broadcastUpdate(END_RUNNING);
              // 停止服务
              stopSelf();
          }
      };
// 开始倒计时
      mCodeTimer.start();
      return super.onStartCommand(intent, flags, startId);
  }
 
Example #14
Source File: WelcomeActivity.java    From android-AutofillFramework with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.welcome_activity);
    final TextView countdownText = findViewById(R.id.countdownText);
    new CountDownTimer(5000, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            int secondsRemaining = toIntExact(millisUntilFinished / 1000);
            countdownText.setText(getResources().getQuantityString
                    (R.plurals.welcome_page_countdown, secondsRemaining, secondsRemaining));
        }

        @Override
        public void onFinish() {
            if (!WelcomeActivity.this.isFinishing()) {
                finish();
            }
        }
    }.start();
}
 
Example #15
Source File: Toaster.java    From AIMSICDL with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Long toast message
 * TOAST_DURATION_MILLS controls the duration
 * currently set to 6 seconds
 * @param context Application Context
 * @param msg     Message to send
 */
public static void msgLong(final Context context, final String msg) {
    if (context != null && msg != null) {
        if (toast != null) {
            toast.cancel();
        }

        new Handler(context.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
                new CountDownTimer(Math.max(TOAST_DURATION_MILLS - SHORT_TOAST_DURATION, 1000), 1000) {
                    @Override
                    public void onFinish() {
                        toast.show();
                    }

                    @Override
                    public void onTick(long millisUntilFinished) {
                        toast.show();
                    }
                }.start();
            }
        });
    }
}
 
Example #16
Source File: ConfirmActivity.java    From AndroidSDK with Apache License 2.0 6 votes vote down vote up
private void initUI(Confirm confirm) {
  if (confirm == null) {
    confirm = getIntent().getParcelableExtra(ARG_CONFIRM);
  }

  activityConfirmPhoneNumber.setText(confirm.getPhone());
  activityRepeatImage.setVisibility(View.GONE);
  activityConfirmTimer.setVisibility(View.VISIBLE);
  new CountDownTimer(confirm.getWait(), 1000) {
    public void onTick(long millisUntilFinished) {
      activityConfirmTimer.setText("0:" + String.valueOf(millisUntilFinished / 1000));
    }
    public void onFinish() {
      activityRepeatImage.setVisibility(View.VISIBLE);
      activityConfirmTimer.setVisibility(View.GONE);
    }
  }.start();
}
 
Example #17
Source File: PocketProtector.java    From Huochexing12306 with Apache License 2.0 6 votes vote down vote up
@Override
public boolean start(Object obj) {
	try{
		mSensorManger = (SensorManager)getmServiceContext().getSystemService(Context.SENSOR_SERVICE);
		mSensor = mSensorManger.getDefaultSensor(Sensor.TYPE_PROXIMITY);
		mSensorListener = new MySensorListener();
		request(AntiTheftService.REQUEST_SHOW_MSG, getName() + "防护已开启,将在10秒后正式生效" + SF.TIP);
		mCDTimer = new CountDownTimer(10000, 1000) {
			
			@Override
			public void onTick(long millisUntilFinished) {
			}
			
			@Override
			public void onFinish() {
				mSensorManger.registerListener(mSensorListener, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
			}
		};
		setNeedDelay(true);
		mCDTimer.start();
		return true;
	}catch(Exception e){
		request(AntiTheftService.REQUEST_SHOW_MSG, "开启\"" + getName() + "\"防护失败,可能您的设备不支持距离传感器!");
		return false;
	}
}
 
Example #18
Source File: PhotoEditorActivity.java    From photo-editor-android with MIT License 6 votes vote down vote up
private void returnBackWithSavedImage() {
    updateView(View.GONE);
    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    parentImageRelativeLayout.setLayoutParams(layoutParams);
    new CountDownTimer(1000, 500) {
        public void onTick(long millisUntilFinished) {

        }

        public void onFinish() {
            String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
            String imageName = "IMG_" + timeStamp + ".jpg";
            Intent returnIntent = new Intent();
            returnIntent.putExtra("imagePath", photoEditorSDK.saveImage("PhotoEditorSDK", imageName));
            setResult(Activity.RESULT_OK, returnIntent);
            finish();
        }
    }.start();
}
 
Example #19
Source File: BaseRecordingActivity.java    From fritz-examples with MIT License 6 votes vote down vote up
private void showStartRecordingViews() {
    videoRecordingProgress.setVisibility(View.VISIBLE);
    videoRecordingProgress.setMax(NUM_PROGRESS_INTERVALS);
    videoRecordingProgress.setProgress(0);

    chooseModelBtn.setVisibility(View.GONE);
    mCountDownTimer = new CountDownTimer(MAX_RECORDING_TIME_MS, TIME_BETWEEN_RECORDING_INTERVAL_MS) {

        @Override
        public void onTick(long millisUntilFinished) {
            int progress = (int) (NUM_PROGRESS_INTERVALS - millisUntilFinished / TIME_BETWEEN_RECORDING_INTERVAL_MS);
            videoRecordingProgress.setProgress(progress);
        }

        @Override
        public void onFinish() {
            // finish recording when MAX_RECORDING_TIME_MS is met
            if (isRecording.compareAndSet(true, false)) {
                videoRecordingProgress.setProgress(NUM_PROGRESS_INTERVALS);
                showFinishRecordingViews();
            }
        }
    };
    mCountDownTimer.start();
}
 
Example #20
Source File: MonitorActivity.java    From haven with GNU General Public License v3.0 6 votes vote down vote up
private void initTimer() {
    txtTimer.setTextColor(getResources().getColor(R.color.colorAccent));
    cTimer = new CountDownTimer((preferences.getTimerDelay()) * 1000, 1000) {

        public void onTick(long millisUntilFinished) {
            mOnTimerTicking = true;
            txtTimer.setText(getTimerText(millisUntilFinished));
        }

        public void onFinish() {

            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
            txtTimer.setText(R.string.status_on);
            initMonitor();
            mOnTimerTicking = false;
        }

    };

    cTimer.start();


}
 
Example #21
Source File: DrawTextActivity.java    From android-openGL-canvas with Apache License 2.0 6 votes vote down vote up
private void initTextureView() {
    drawTextTextureView = findViewById(R.id.media_player_texture_view);
    final TextView frameRateTxt = findViewById(R.id.frame_rate_txt);

    drawTextTextureView.setOnSurfaceTextureSet(new GLSurfaceTextureProducerView.OnSurfaceTextureSet() {
        @Override
        public void onSet(SurfaceTexture surfaceTexture, RawTexture surfaceTextureRelatedTexture) {
            // No need to request draw because it is continues GL View.

            mediaSurface = new Surface(surfaceTexture);
        }
    });
    countDownTimer = new CountDownTimer(1000 * 3600, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            frameRateTxt.setText(String.valueOf(drawTextTextureView.getFrameRate()));
        }

        @Override
        public void onFinish() {

        }
    };
    countDownTimer.start();
}
 
Example #22
Source File: TestingActivity.java    From ibm-wearables-android-sdk with Apache License 2.0 6 votes vote down vote up
private void handleResult(JSONObject json) {
    detectedLayout.setVisibility(View.VISIBLE);
    sensingLayout.setVisibility(View.INVISIBLE);

    String recognizedGesture = json.optString("recognized");
    detectedGesture.setText(recognizedGesture);
    score.setText(String.format(getString(R.string.gesture_score),json.optString("score")));
    sayText(recognizedGesture);

    new CountDownTimer(1500, 1500) {
        public void onTick(long millisUntilFinished) {

        }

        public void onFinish() {
            detectedLayout.setVisibility(View.INVISIBLE);
            sensingLayout.setVisibility(View.VISIBLE);
        }
    }.start();
}
 
Example #23
Source File: MediaRecorderBase.java    From VideoRecord with MIT License 6 votes vote down vote up
/** 
 * 测试PreviewFrame回调次数,时间1分钟
 * 
 */
public void testPreviewFrameCallCount() {
	new CountDownTimer(1 * 60 * 1000, 1000) {

		@Override
		public void onTick(long millisUntilFinished) {
			android.util.Log.e("[Vitamio Recorder]", "testFrameRate..." + mPreviewFrameCallCount);
			mPreviewFrameCallCount = 0;
		}

		@Override
		public void onFinish() {

		}

	}.start();
}
 
Example #24
Source File: TimerTextView.java    From DebugRank with Apache License 2.0 6 votes vote down vote up
public void startTimer()
{
    countDownTimer = new CountDownTimer(timeInSeconds * 1000, 1000)
    {
        @Override
        public void onTick(long millisUntilFinished)
        {
            if (canUpdate.get())
            {
                timeInSeconds = (int) Math.floor(millisUntilFinished / 1000);

                setTimeText();
            }
        }

        @Override
        public void onFinish()
        {
            timeInSeconds = 0;
            setTimeText();
            timerCompletedListener.timeRanOut();
        }
    }.start();
}
 
Example #25
Source File: CountDownButtonHelper.java    From AndroidStudyDemo with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param button 需要显示倒计时的Button
 * @param defaultString 默认显示的字符串
 * @param max 需要进行倒计时的最大值,单位是秒
 * @param interval 倒计时的间隔,单位是秒
 */
public CountDownButtonHelper(final Button button,
                             final String defaultString, int max, int interval) {
    this.mCountDownBtn = button;
    // 由于CountDownTimer并不是准确计时,在onTick方法调用的时候,time会有1-10ms左右的误差,这会导致最后一秒不会调用onTick()
    // 因此,设置间隔的时候,默认减去了10ms,从而减去误差。
    // 经过以上的微调,最后一秒的显示时间会由于10ms延迟的积累,导致显示时间比1s长max*10ms的时间,其他时间的显示正常,总时间正常
    mCountDownTimer = new CountDownTimer(max * 1000, interval * 1000 - 10) {
        @Override
        public void onTick(long time) {
            // 第一次调用会有1-10ms的误差,因此需要+15ms,防止第一个数不显示,第二个数显示2s
            button.setText(defaultString + "(" + ((time + 15) / 1000)
                    + "秒)");
        }

        @Override
        public void onFinish() {
            button.setEnabled(true);
            button.setText(defaultString);
            if (mOnFinishListener != null) {
                mOnFinishListener.finish();
            }
        }
    };
}
 
Example #26
Source File: FloatWaitView.java    From ClockView with Apache License 2.0 6 votes vote down vote up
private void createTimer() {
    timer = new CountDownTimer(duration, duration / (ovalNum + 1)) {
        @Override
        public void onTick(long millisUntilFinished) {
            if (position < ovalNum) {
                Oval oval = mOvals.get(position++);
                oval.mAnimator.start();
            }
        }

        @Override
        public void onFinish() {

        }
    };
    timer.start();
}
 
Example #27
Source File: StartActivity.java    From smart-farmer-android with Apache License 2.0 6 votes vote down vote up
private void startCountDown(long millisInFuture) {
    if (countDownTimer != null) {
        countDownTimer.cancel();
    }
    countDownTimer = new CountDownTimer(millisInFuture + 500, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            mBtnJump.setText(String.format(Locale.CHINA, "%ds跳过", millisUntilFinished / 1000));
        }

        @Override
        public void onFinish() {
            mBtnJump.setText(R.string.jump_over_0s);
            gotoNextPage();
        }
    }.start();
}
 
Example #28
Source File: StartActivity.java    From smart-farmer-android with Apache License 2.0 6 votes vote down vote up
private void startCountDown(long millisInFuture) {
    if (countDownTimer != null) {
        countDownTimer.cancel();
    }
    countDownTimer = new CountDownTimer(millisInFuture + 500, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            mBtnJump.setText(String.format(Locale.CHINA, "%ds跳过", millisUntilFinished / 1000));
        }

        @Override
        public void onFinish() {
            mBtnJump.setText(R.string.jump_over_0s);
            gotoNextPage();
        }
    }.start();
}
 
Example #29
Source File: SplashActivity.java    From SprintNBA with Apache License 2.0 6 votes vote down vote up
@Override
protected void initViewsAndEvents() {
    int index = (int) (Math.random() * imgs.length);

    ivBg.setImageResource(imgs[index]);

    timer = new CountDownTimer(3500, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            tvSkip.setText(String.format(getResources().getString(R.string.skip), (int) (millisUntilFinished / 1000 + 0.1)));
        }

        @Override
        public void onFinish() {
            tvSkip.setText(String.format(getResources().getString(R.string.skip), 0));
            startActivity(new Intent(mContext, HomeActivity.class));
            finish();
        }
    };
    timer.start();
}
 
Example #30
Source File: DownTimer.java    From sealtalk-android with MIT License 6 votes vote down vote up
/**
 * [倒计为time长的时间,时间间隔为mills]
 * @param time
 * @param mills
 */
public void startDown(long time, long mills){
	mCountDownTimer = new CountDownTimer(time, mills){
		@Override
		public void onTick(long millisUntilFinished) {
			if(listener != null){
				listener.onTick(millisUntilFinished);
			}else{
				NLog.e(TAG, "DownTimerListener 监听不能为空");
			}
		}

		@Override
		public void onFinish() {
			if(listener != null){
				listener.onFinish();
			}else{
				NLog.e(TAG, "DownTimerListener 监听不能为空");
			}
			if(mCountDownTimer != null)mCountDownTimer.cancel();
		}
		
	}.start();
}