What is the different between Explicit and implicit activity call in android?

后端 未结 7 1315
感动是毒
感动是毒 2020-12-01 03:11

What is the difference between explicit and implicit activity call in android? If you explain the answer with a simple example will be good.

7条回答
  •  温柔的废话
    2020-12-01 03:36

    There are two types of intents:

    • Explicit Intent:

      While creating an Intent object when we explicitly specify and pass on the target component name directly in the intent, it’s an explicit intent.

    • Implicit Intent:

      In this case we delegate the task of evaluating the registered components (registration is usually done using intent filters that we’ll cover later) to Android based on the intent data and the intended action (like send an email, capture a photo, pin location on a map, etc.) that we pass. So Android will automatically fire up the component from the same app or some other app that can handle the intent message/job. The idea in this case is that, let’s say we have to pin a location on a map, for that we don’t have to code our own activity to handle that. Instead just pass on the location data to an app like Google maps that can do the job on our app’s behalf.

    source : http://codetheory.in/android-intents/

提交回复
热议问题