search

Home  >  Q&A  >  body text

Android HandlerCallback.handlerMessage 归属线程

巴扎黑巴扎黑2821 days ago797

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-17 13:12:02

    The logic inside

    1, Show and handleMessage is not in the main thread.
    2. ImageSize=0 is output at other points because your Show has not yet called back and the image has not been downloaded.
    3. When handleMessage is executed, the thread it is on is the thread where the new Handler() passed in when you Looper is located (you used HandlerThread), so in the entire logic of handleMessage, there is no other code. Possibility of main thread execution.

    reply
    0
  • Cancelreply