VolodymyrH
VolodymyrH

Reputation: 2019

How intents and startActvity works internally?

Everyone knows if you create intent to start another activity, you pass in as a parameter into startActivity. But I just thought about the possible scenario: intent says system "call this activity", the system sees manifest and then runs activity, or this running acts internally in the app, something like "call some method of some class"? Probably a stupid question, but I couldn't find enough info. So how does it works?

Upvotes: 0

Views: 159

Answers (1)

Sagar
Sagar

Reputation: 24947

Following is the way how intent communication works:

intentcomm

  1. Activity A creates an Intent with an action description and passes it to startActivity().

  2. The Android System searches all apps for an intent filter that matches the intent. When a match is found,

  3. the system starts the matching activity (Activity B) by invoking its onCreate() method and passing it the Intent.!

Upvotes: 1

Related Questions