a亚洲精品_精品国产91乱码一区二区三区_亚洲精品在线免费观看视频_欧美日韩亚洲国产综合_久久久久久久久久久成人_在线区

首頁 > 系統(tǒng) > Android > 正文

Android中的Looper對象詳細介紹

2020-04-11 11:55:06
字體:
供稿:網(wǎng)友

Java 官網(wǎng)對Looper對象的說明:


public class Looperextends Object
Class used to run a message loop for a thread. Threads by default do not have a message loop associated with them; to create one, call prepare() in the thread that is to run the loop, and then loop() to have it process messages until the loop is stopped.

Most interaction with a message loop is through the Handler class.

This is a typical example of the implementation of a Looper thread, using the separation of prepare() and loop() to create an initial Handler to communicate with the Looper.

復制代碼 代碼如下:

  class LooperThread extends Thread {
      public Handler mHandler;

      public void run() {
          Looper.prepare();

          mHandler = new Handler() {
              public void handleMessage(Message msg) {
                  // process incoming messages here
              }
          };

          Looper.loop();
      }
  }

主要方法:

static void loop() :  Run the message queue in this thread.
static void prepare() :  Initialize the current thread as a looper.

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 在线亚洲观看 | avmans最新导航地址 | 国产成人免费在线观看视频 | 久久综合99re88久久爱 | 国产一区二区三区四区五区加勒比 | 婷婷综合 | 国产日韩欧美 | 久久久久久久一区 | 欧美一级片在线看 | 精品九九久久 | 亚洲电影一区二区 | 福利亚洲| 成年人在线看片 | 欧美一区二区在线观看 | 精品在线不卡 | 99爱视频 | 日韩精品免费一区二区夜夜嗨 | 青青草久 | 亚洲三级在线 | 黄色毛片视频网站 | 国产精品久久久久久久久免费桃花 | 免费看的av | 六月色婷婷| 亚洲视频一区二区三区四区 | 久久国产精品免费一区二区三区 | 免费av一区 | 99在线视频精品 | 欧美黄色a视频 | 欧美日韩精品一区二区三区蜜桃 | 欧美精品在线一区二区三区 | 日韩一区高清视频 | 成人二区 | 国产成人精品免高潮在线观看 | 久久久久久亚洲精品 | 欧美成人激情视频 | 91在线免费看 | 欧美伦理一区二区 | 黄色你懂的 | 福利电影在线观看 | 国产成人免费 | 亚洲天堂久 |