Android定时器实现定时执行、重复执行、定时重复执行、定定时器实现定时执行、重复执行、定时重复执行、定
次数执行的多种方式次数执行的多种方式
作用:作用:
1、定时执行某种功能
2、重复执行、定时重复执行、定次数执行某种功能
类别:类别:
1、 Thread(new Runnable)
2、Thread()
3、Timer
4、Handler
·····
代码如下:
1、布局、布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/show_time"
评论0