Updating UI from a service (using a handler?)

前端 未结 3 544
谎友^
谎友^ 2020-12-11 06:12

I am trying to update my UI in FirstActivity when I receive a notification but is confused by runOnUiThread , Runnable and Handl

3条回答
  •  Happy的楠姐
    2020-12-11 06:51

    I've always just had the service fire off a Broadcast and then in my Activity I have a BroadcastReciever listening for the Broadcast. It's an approach that is much simpler than the one you outlined above.

提交回复
热议问题