1. Handler使用引出

現(xiàn)在作為客戶(hù),有這樣一個(gè)需求,當(dāng)打開(kāi)Activity界面時(shí),開(kāi)始倒計(jì)時(shí),倒計(jì)時(shí)結(jié)束后跳轉(zhuǎn)新的界面(思維活躍的朋友可能立馬想到如果打開(kāi)后自動(dòng)倒計(jì)時(shí),就類(lèi)似于各個(gè)APP的歡迎閃屏頁(yè)面),如下圖:

seo優(yōu)化培訓(xùn),網(wǎng)絡(luò)推廣培訓(xùn),網(wǎng)絡(luò)營(yíng)銷(xiāo)培訓(xùn),SEM培訓(xùn),網(wǎng)絡(luò)優(yōu)化,在線(xiàn)營(yíng)銷(xiāo)培訓(xùn)

作為初學(xué)者,可能覺(jué)得直接開(kāi)啟一個(gè)包含倒序循環(huán)的子線(xiàn)程就ok了,具體實(shí)現(xiàn)如下:

1.1 Layout界面代碼如下:

seo優(yōu)化培訓(xùn),網(wǎng)絡(luò)推廣培訓(xùn),網(wǎng)絡(luò)營(yíng)銷(xiāo)培訓(xùn),SEM培訓(xùn),網(wǎng)絡(luò)優(yōu)化,在線(xiàn)營(yíng)銷(xiāo)培訓(xùn)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main2"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.mly.panhouye.handlerdemo.Main2Activity">
    <TextView
        android:gravity="center"
        android:textSize="30sp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="NO DATA"
        android:id="@+id/tv"/>
</LinearLayout>

seo優(yōu)化培訓(xùn),網(wǎng)絡(luò)推廣培訓(xùn),網(wǎng)絡(luò)營(yíng)銷(xiāo)培訓(xùn),SEM培訓(xùn),網(wǎng)絡(luò)優(yōu)化,在線(xiàn)營(yíng)銷(xiāo)培訓(xùn)

1.2 java實(shí)現(xiàn)代碼如