教你实现splash欢迎页面延迟跳转的6种方法
生活随笔
收集整理的這篇文章主要介紹了
教你实现splash欢迎页面延迟跳转的6种方法
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
教你實(shí)現(xiàn)splash頁(yè)面延遲跳轉(zhuǎn)的六種方法(個(gè)人總結(jié))?
實(shí)現(xiàn)方式一:private void initSplashPage() {new Handler().postDelayed(new Runnable() {@Overridepublic void run() {//跳轉(zhuǎn)頁(yè)面Intent intent = new Intent(ShoppingCartActivity.this,spalsh.class);startActivity(intent);}}, 3000);}實(shí)現(xiàn)方式二private void initSplashPage() {Runnable runnable = new Runnable() {@Overridepublic void run() {//跳轉(zhuǎn)頁(yè)面Intent intent = new Intent(ShoppingCartActivity.this, spalsh.class);startActivity(intent);}};new Handler().postDelayed(runnable, 3000);}
實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)方法三private void initSplashPage() {new Thread(new Runnable() {@Overridepublic void run() {try {Thread.sleep(3000);} catch (InterruptedException e) {e.printStackTrace();}//睡3秒后跳轉(zhuǎn)頁(yè)面//跳轉(zhuǎn)頁(yè)面Intent intent = new Intent(ShoppingCartActivity.this, spalsh.class);startActivity(intent);}}).start();}
實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)方法四private void initSplashPage() {new Thread(new Runnable() {@Overridepublic void run() {SystemClock.sleep(3000);//睡3秒后跳轉(zhuǎn)頁(yè)面//跳轉(zhuǎn)頁(yè)面Intent intent = new Intent(ShoppingCartActivity.this, spalsh.class);startActivity(intent);}}).start();}
實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)方法五private void initSplashPage() {new Thread(){@Overridepublic void run() { // super.run();SystemClock.sleep(3000);//睡3秒后跳轉(zhuǎn)頁(yè)面//跳轉(zhuǎn)頁(yè)面Intent intent = new Intent(ShoppingCartActivity.this, spalsh.class);startActivity(intent);}}.start();}
實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)方法六private void initSplashPage() {new Thread(){@Overridepublic void run() { // super.run();try {Thread.sleep(3000);} catch (InterruptedException e) {e.printStackTrace();}//睡3秒后跳轉(zhuǎn)頁(yè)面//跳轉(zhuǎn)頁(yè)面Intent intent = new Intent(ShoppingCartActivity.this, spalsh.class);startActivity(intent);}}.start();}
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)
總結(jié)
以上是生活随笔為你收集整理的教你实现splash欢迎页面延迟跳转的6种方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 关于git的初试
- 下一篇: 关于ViewPager使用出现的图片覆盖