码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-12-21 23:28:28      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:

// 定义一个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

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

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!