Android implements the countdown jump on the pop-up page and the top right corner, and android jump
:
The handler and CountDownTimer classes are used in the pop-up page. You also need to configure the theme of the Activity, which is android: Theme = "@ android: style/theme. noTitleBar. fullscreen "indicates the full screen topic.
Source code:
Package com. example. shanping; import java. lang. ref. weakReference; import com. example. shanping. myActivity. myCountDownTimer; import android. OS. bundle; import android. OS. countDownTimer; import android. OS. handler; import android. OS. message; import android. app. activity; import android. content. intent; import android. util. log; import android. view. menu; import android. widget. textView; public class MainActivity extends Activity {private MyCountDownTimer mc; private TextView TV; @ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); TV = (TextView) findViewById (R. id. textView1); mc = new MyCountDownTimer (3000,100 0); mc. start (); handler. postDelayed (new Runnable () {@ Override public void run () {Intent intent = new Intent (MainActivity. this, MyActivity. class); startActivity (intent); }}, 3000);} private Handler handler = new Handler (); /*** inherit CountDownTimer prevention *** override the methods onTick () and onFinish () of the parent class () */class MyCountDownTimer extends CountDownTimer {/***** @ param millisInFuture * indicates the total number of Countdown times in milliseconds. ** for example, millisInFuture = 1000 indicates 1 second. ** @ param countDownInterval * indicates interval: How many microseconds does one onTick method call? ** example: countDownInterval = 1000; indicates that onTick () **/public MyCountDownTimer (long millisInFuture, long countDownInterval) {super (millisInFuture, countDownInterval);} public void onFinish () is called every 1000 milliseconds () {TV. setText ("redirecting");} public void onTick (long millisUntilFinished) {TV. setText ("Countdown (" + millisUntilFinished/1000 + ")");}}}