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

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


startActivity(intent) and startActivityForResult(intent) are asynchronous in the sense that these methods return immediately without starting an Activity. Actually, they schedule an Activity to start only after the lifecycle events of the current Activity is finished.

The takeaway is, if you have something, that takes some time to finish, in the onPause() method of the first activity , the new Activity will be slow to start.


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.