0 votes
in Android by
Explain the difference between Implicit and Explicit Intent.

1 Answer

0 votes
by

The difference between the implicit and explicit Intents are given below:

Explicit Intent:

An Explicit Intent is where you inform the system about which activity should handle this intent. Here target component is defined directly in the intent.

For example,

Intent i = new Intent(this, Activitytwo.class); #ActivityTwo is the target component

i.putExtra("Value1","This is ActivityTwo"); 

i.putExtra("Value2","This Value two for ActivityTwo"); 

startactivity(i);

Implicit Intent:

An Implicit Intent permits you to declare the action you want to carry out. Further, the Android system will check which components are registered to handle that specific action based on intent data. Here target component is not defined in the intent.

For example,

Intent i = new Intent(ACTION_VIEW,Uri.parse("http://www.interview bit.com")); 

startActivity(i);

...