倒计时跳转界面

//倒计时

    private void initData() {
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (mTime == 0){
                    startActivity(new Intent(MainActivity.this,Main2Activity.class));
                    finish();
                }else {
                    mTime--;
                    mTv.setText(mTime+"");
                    initData();
                }
            }
        },1000);
    }

你可能感兴趣的:(倒计时跳转界面)