logo
  • 教程列表
  • SO官方文檔
  • Looper
    • 建立一個簡單的 LooperThread
    • 使用 HandlerThread 執行迴圈
  1. StackOverflow 文件
  2. Android 教程
  3. Looper
  4. 使用 HandlerThread 執行迴圈

使用 HandlerThread 執行迴圈

Created: November-22, 2018

一個 HandlerThread 可以用來啟動一個 Looper 一個執行緒。然後可以使用此迴圈器建立一個與其通訊的 Handler。

HandlerThread thread = new HandlerThread("thread-name");
thread.start();
Handler handler = new Handler(thread.getLooper());
  • 建立一個簡單的 LooperThread

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明