您的位置:首页 > 其它

第一次进入有欢迎页,以后在不出现

2015-12-04 17:00 531 查看

在mainfest中guide页

<action android:name="android.intent.action.`这里写代码片`MAIN" />


private SharedPreferences sharepreferences;
private SharedPreferences.Editor editor;
....
oncreat()
sharepreferences=this.getSharedPreferences("check", MODE_PRIVATE);
editor=sharepreferences.edit();

boolean fristload=sharepreferences.getBoolean("fristload", true);

if (!fristload) {
Intent intent = new Intent();
intent.setClass(this,toActivity.class);
startActivityForResult(intent,0);
}
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {

editor.putBoolean("fristload", false);

Intent intent = new Intent();
intent.setClass(this,toActivity.class);

startActivityForResult(intent, 0);

}
}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: