zoukankan      html  css  js  c++  java
  • 引导页之页面等待3秒跳转

    效果图:

    页面布局:

    二:activity的编写,用到时间空间戳

    package com.example.administrator.myapplication;

    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;
    import android.view.View;
    import android.widget.TextView;

    /**  跳转时间倒计时页面
     * Created by Administrator on 2016/12/23.
     */

    public class JumpActivity extends Activity {
        TextView textView;
        int time=3;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.jump);
            textView= (TextView) findViewById(R.id.textview);

            handler.postDelayed(runnable,3000);

        }
        Handler handler=new Handler();
        Runnable runnable=new Runnable() {
            @Override
            public void run() {
                time--;
                handler.postDelayed(this,2000);
                textView.setText("跳转:"+time+"秒");

                if(time==0){
                    Intent intent=new Intent(JumpActivity.this,TestActivity.class);
                    startActivity(intent);
                    finish();
                }else {
                    textView.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent intent=new Intent(JumpActivity.this,TestActivity.class);
                            startActivity(intent);
                            //结束线程
                            handler.removeCallbacks(runnable);
                            finish();
                        }
                    });
                }
            }
        };
    }

  • 相关阅读:
    MetaNamespaceKeyFunc
    golang dlv 调式成员函数
    golang 编译 添加debug gdb
    code-generator
    k8s 自定义informer
    kube-batch ——pod 和task
    kubernetes-handbook informer
    kube batch scheduler
    k8s-scheduler-extender-example
    volcano 快速开始
  • 原文地址:https://www.cnblogs.com/ll-ouyang/p/6364768.html
Copyright © 2011-2022 走看看