Saturday, January 25, 2014

android application development: The first time you open the app is a welcome page, after the introduction of each and then open directly into the main page, how to design a page in relations app


            
android application development: The first time you open the app is a welcome page, after the introduction of each and then open directly into the main page, how to design a page in relations app
Reply:
In the Welcome screen to determine what, if not the first time you start, you jump to the main interface. Yes, I do not jump.
Reply:
How to judge it? Find an example! Thank you
Reply:
How to judge it? Find an example! Thank you
Reply:
You can use a variety of storage to determine whether the first start, such as sp, such as xml
Reply:
Write a stupid point on a file with a clever point SharedPreferences
Reply:
I just applied inside the other, just to share to you: In mainfest the guide page

guide page:
 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);

}
}
});

No comments:

Post a Comment