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

Android 第一次运行程序提示框操作

2017-02-10 09:37 459 查看
代码:

preferences = getSharedPreferences("count",MODE_WORLD_READABLE);
int count = preferences.getInt("count", 0);

//判断程序与第几次运行,如果是第一次运行则跳转到引导页面
if (count == 0) {
Intent intent = new Intent();
intent.setClass(getApplicationContext(),LaunchGuideViewActivity.class);
startActivity(intent);
this.finish();
}
Editor editor = preferences.edit();
//存入数据
editor.putInt("count", ++count);
//提交修改
editor.commit();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: