+ 5
What is the different between explicit and implicit intent in android ?
2 Réponses
+ 3
Explicit Intent: Explicit intent names the component.
Implicit Intent: Implicit Intents have not specified a component.
E.g: The java class which should be called Implicit intent asked the system to perform a service without telling the system which java class should do this service.
+ 2
Explicit intents are those that are called specifically using a class. For example starting another activity in your app is an explicit intent because you define the component class.
Example: Intent intent = new Intent(this, SettingsActivity.class);
Implicit intents are those that are handled by the Android OS. For example sending an intent to open a web page. This is implicit because you are not defining what component class to use. Instead the Android OS registers an intent to all the web browsers and at most times, your default Web browser will open.
Example: Intent intent = new Intent(Intent.ACTION_VIEW);