读书人

android应用开发:第一次打开app时是欢

发布时间: 2014-05-14 16:14:09 作者: rapoo

android应用开发:第一次打开app时是欢迎页,推出之后每次再打开都直接进入主页面,如何设计app的页面关系
android应用开发:第一次打开app时是欢迎页,推出之后每次再打开都直接进入主页面,如何设计app的页面关系
[解决办法]
在欢迎界面判断一下,如果不是第一次启动,就跳转到主界面。是的话,不跳转。
[解决办法]
笨点就写个一个文件上,聪明点就用个SharedPreferences
[解决办法]
正好我的应用里面有这个,就分享给你了:在mainfest中guide页<action android:name="android.intent.action.MAIN" />

guide页面:

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);

}
}
});

读书人网 >Android

热点推荐