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:
public void
onCreate (Bundle savedinstancestate) {
super.oncreate (savedinstancestate);
Setcontentview (r.layout.main);
Preferences = Getsharedpreferences ("Count", mode_world_readable);
int count = Preferences.getint ("Count", 0);
Judge the program with the number of runs, if it is the first run will jump 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);
Submit modification
editor.commit ();