The pop-up screen is the splashscreen. It can also be called the startup screen, that is, when the screen is started, it will be flashed (displayed) and automatically closed after several seconds.
The implementation of Android is very simple. It can be implemented using the postdelayed method of the handler object. In this method, a runnable object and a delay time are passed. This method achieves a delayed execution effect. The delay time is specified by 2nd parameters, in milliseconds. The first parameter is the runnable object, which contains the operations to be performed after the delay.
The Code is as follows:
New handler (). postdelayed (New runnable (){
@ Override
Public void run (){
// Todo auto-generated method stub
Intent intent = new intent (actsplashscreen. This, actmain. Class );
Startactivity (intent );
Actsplashscreen. This. Finish ();
}
},2500 );
The code above shows that the page Jump operation is performed with a latency of 2500 milliseconds. The specific operation is in the implementation of the run method.
The specific steps are as follows:
1. Implement a pop-up form and Set background images.
2. Implement the main form. The form will be started after the screen flash ends.
2. Handle a delayed page Jump operation in the oncreate method overload in the pop-up form. The method is shown in the code above. Jump to the main form of the program here