sp = getSharedPreferences("WelCome", MODE_PRIVATE);
boolean isFirst = sp.getBoolean("isFirst", true);
if(isFirst==true){
Editor editor = sp.edit();
editor.putBoolean("isFirst", false);
editor.commit();
}else{
Intent intent = new Intent(this,MainActivity.class);
startActivity(intent);
finish();
}
在欢迎页面加上上述代码即可,Sooooooooooooooooooooooooooooo easy!
第一次进入欢迎页面,第二次以后直接进入主页面示例代码
最新推荐文章于 2024-06-25 21:59:35 发布