Junior — Middle
Can you explain what Implicit Intent is in Android?
sobes.tech AI
Answer from AI
In Android, implicit intents are used to launch components (Activity, Service, BroadcastReceiver) without specifying a particular class. Instead, the intent specifies an action, data, and category, and the system chooses the appropriate component capable of handling that intent.
For example, if you want to open a web page, you can create an implicit intent with the ACTION_VIEW action and a URL, and Android will prompt the user to choose a browser to open the link.
Example:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://example.com"));
startActivity(intent);
Thus, implicit intents allow for creating flexible and extensible applications that interact with other apps and system components.