您的位置:首页 > 移动开发

【安卓】安卓App开发思路 一步一个脚印(一)欢迎界面

2016-09-21 23:02 633 查看

一.欢迎界面

功能点描述:

       1 应用的第一个界面

       2 3秒之后自动关闭

                 第一次使用的时候就跳转到新手引导,  不是第一次使用就跳转到主页面

       3 不能返回,禁止返回键


实现采用  Handler postDelayed(new Runnable(){},3000); 一般为3秒钟自动跳过,具体得看app需求

根据 sharedPreferences 拿到数值 为空这初始化  get+类型("参数名字",初始值) ,

设置值为 

Editor editor=sharePreferences.edit();

editor.put+类型("参数名字",设置值) ;

editor.commit();

SharedPreferences sharedPreferences = getPreferences(Context.MODE_PRIVATE);
boolean isfirst = sharedPreferences.getBoolean("isFirst",true);
if(isfirst){//是第一次
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("isFirst",false);//设置为不是第一次
editor.commit();
startActivity(new Intent(SplashActivity.this,GuideActivity.class));
}else{//不是第一次
startActivity(new Intent(SplashActivity.this,MainActivity.class));
}


重点 实现不白屏幕

待续。。

     
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  app 界面 android 框架
相关文章推荐