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

一.欢迎界面

功能点描述:
       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));
}


重点 实现不白屏幕

待续。。






     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值