1. Handler使用引出
現在作為客戶,有這樣一個需求,當打開Activity界面時,開始倒計時,倒計時結束后跳轉新的界面(思維活躍的朋友可能立馬想到如果打開后自動倒計時,就類似于各個APP的歡迎閃屏頁面),如下圖:
作為初學者,可能覺得直接開啟一個包含倒序循環的子線程就ok了,具體實現如下:
1.1 Layout界面代碼如下:
<?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>
文章標題:Android中handler使用淺析-創新互聯
文章URL:http://vcdvsql.cn/article44/jsghe.html
成都網站建設公司_創新互聯,為您提供響應式網站、網站收錄、搜索引擎優化、域名注冊、面包屑導航、網站內鏈
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯