引导界面(只显示一次)的实现

// 定义一个setting记录APP是几次启动!!!
        SharedPreferences setting = getSharedPreferences("com.example.welcome",
                0);
        Boolean user_first = setting.getBoolean("FIRST", true);
        if (user_first) {// 第一次则跳转到欢迎页面
            setting.edit().putBoolean("FIRST", false).commit();
        } else {// 如果是第二次启动则直接跳转到主页面
            tiaoZhuan();
        }
public void tiaoZhuan() {
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                Intent mIntent = new Intent(WelcomeActivity.this,
                        MainActivity.class);
                startActivity(mIntent);
                finish();
            }
        });
    }

要实现延时操作使用handler.postDelayed

原文地址:https://www.cnblogs.com/zzw1994/p/5064991.html