Is it safe to finish an android activity from a background thread?

后端 未结 2 2292
醉梦人生
醉梦人生 2021-02-20 04:09

In Android, is it safe to call Activity.finish() from a background thread, or can it only called from the main thread? The documentation doesn\'t mention anything a

2条回答
  •  既然无缘
    2021-02-20 04:54

    Probably the result could be unexpected. I'd use a Handler or some other way to send to the activity the order to kill itself in the next iteration.

提交回复
热议问题