Can someone please explain how startActivity(intent) and startActivityForResult(intent) are Asynchronous?

后端 未结 2 472
太阳男子
太阳男子 2021-02-12 13:38

If an Asynchronous thread is a thread that operates separately to the main thread and doesn\'t interfere with the main thread...

Does a new Activity not occ

2条回答
  •  孤城傲影
    2021-02-12 14:06

    When you startActivityForResult you still perform an asynchronous call. Your caller activity gets suspended and the new is started in another process (if it runs under a different user).

    But when the called activity terminates setting a result, your activity is resumed and you get onActivityResult called as a callback containing the result.

提交回复
热议问题