What is Device.BeginInvokeOnMainThread for?

前端 未结 3 1473
無奈伤痛
無奈伤痛 2021-02-01 16:26

I would like someone to explain to me what is Device.BeginInvokeOnMainThread and what is it for?

And also some examples of cases where it\'s used.

3条回答
  •  深忆病人
    2021-02-01 16:41

    You can only update the UI from the main UI thread. If you are running code on a background thread and need to update the UI, BeginInvokeOnMainThread() allows you to force your code to run on the main thread, so you can update the UI.

提交回复
热议问题