First boot after program installation:
Launch page--> feature introduction page--> system Home
Start later:
Start Page--> System home
So it's OK to judge on the launch page.
Can get a file to save a state, recommended with Sharedpreferences.
1. You can define a variable to determine how many times a program is run, and if it is the first time you jump to a guided activity, and if not the first time, perform the system home page.
The system is judged to be the first to run with the following code implementation:
To add code to the activity:
Use Sharedpreferences to record the number of times a program is used
Here's the implementation code:
Copy Code code as follows:
<span style= "font-size:18px" ><strong>public void OnCreate ( Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.main);
Preferences = getsharedpreferences ("Count", mode_world_readable);
int count = Preferences.getint ("Count", 0);
//The judge program runs with the first run, and jumps to the boot page
if (count = = 0) {
Intent Intent = new Intent ();
Intent.setclass (Getapplicationcontext (), launchguideviewactivity.class);
StartActivity (Intent);
This.finish ();
}
Editor Editor = Preferences.edit ();
//Deposit Data
Editor.putint ("Count", ++count);
//Commit modification
Editor.commit ();</strong></span>