public class ThreadHelper
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static android.os.Handler |
handler
主线程处理器
|
构造器和说明 |
---|
ThreadHelper() |
限定符和类型 | 方法和说明 |
---|---|
static void |
cancel(java.lang.Runnable runnable)
取消执行处理器
|
static boolean |
interrupted()
是否线程已中断(获取状态后会重置为非中断状态,如果不需要重置请使用isInterrupted)
|
static boolean |
isInterrupted()
是否线程已中断
|
static boolean |
isMainThread()
当前线程是否为主线程
|
static void |
post(java.lang.Runnable runnable)
执行处理器
|
static void |
postDelayed(java.lang.Runnable runnable,
long delayMillis)
延时执行处理器
|
static java.lang.Thread |
runThread(java.lang.Runnable runnable)
执行线程任务
|
static void |
sleep(long timeUs)
线程等待
|
public static boolean isMainThread()
public static java.lang.Thread runThread(java.lang.Runnable runnable)
runnable
- public static void post(java.lang.Runnable runnable)
runnable
- 处理器public static void postDelayed(java.lang.Runnable runnable, long delayMillis)
runnable
- 处理器delayMillis
- 延迟毫秒public static void cancel(java.lang.Runnable runnable)
runnable
- 处理器public static void sleep(long timeUs)
public static boolean interrupted()
public static boolean isInterrupted()