Say Main activity is running in Process A, so when an Intent is fired from that Main Activity, does Android System launch one child Process to make in Asynchronous., ?
what happens in the case of startActivityForResult(). It may be the case that the calling Activity does not exist when called activity returns the result . What would happen in that case ? Does Android System creates an instance , or it blocks till the called activity returns the result (in which case it is no more synchronous call) , or crashes ?
The option of "crashing" was a joke, right? If no activity of the right kind is running to receive the result, one will be started. If one can't be started for some unforeseen reason, the process will likely be terminated.
Sahil Rally wrote:The option of crashing was not a joke certainly, because in Android system there are scenarios where it happens. For instance, if we launch an implicit intent with some action and category , and if android system does not find any app that can support that intent , the app crashes. !!! :-)
Steve
Caution: It's possible that a user won't have any apps that handle the implicit intent you send to startActivity(). If that happens, the call will fail and your app will crash. To verify that an activity will receive the intent, call resolveActivity() on your Intent object. If the result is non-null, then there is at least one app that can handle the intent and it's safe to call startActivity(). If the result is null, you should not use the intent and, if possible, you should disable the feature that issues the intent.
Context#startActivity(Intent, Bundle) wrote:This method throws ActivityNotFoundException if there was no Activity found to run the given Intent.
Steve