当前位置:操作系统 > 安卓/Android >>

Android Runnable 用法

从Runnable派生你的子类,重载run()方法。

然后调用View.post(myRunnableObj)即可把你的Runnable对象增加到UI线程中运行。

boolean android.view.View .post(Runnable action)

Causes the Runnable to be added to the message queue. The runnable will be run on the user inte易做图ce thread.

Parameters:
action The Runnable that will be executed.
Returns:
Returns true if the Runnable was successfully placed in to the message queue. Returns false on failure, usually because the looper processing the message queue is exiting.

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,