Handler-Looper implementation in Android

前端 未结 2 1045
礼貌的吻别
礼貌的吻别 2021-01-14 07:01
  1. I have Activity with Handler (UI thread)
  2. I start new Thread and make handler.post(new MyRunnable()) - (new work thread)

Android documentation s

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-14 07:23

    Handler attached to UI thread.

    Correct.

    How android can run runnable in the same UI thread without new thread creation?

    Any thread, including the main application ("UI") thread, can call post() on Handler (or on any View, for that matter).

提交回复
热议问题