Creating Explicit Intents at Runtime

You used an implicit intent to gather the desired activities and present them in a list. The next step is to start the selected activity when the user presses its list item. You will start the activity using an explicit intent.

To create the explicit intent, you need to get the activity’s package name and class name from the ResolveInfo. You can get this data from a part of the ResolveInfo called ActivityInfo. (You can learn what data is available in different parts of ResolveInfo from its reference page: developer.android.com/​reference/​kotlin/​android/​content/​pm/​ResolveInfo.html)

Update ActivityHolder to implement a click listener. When an activity in the list is pressed, use the ActivityInfo ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.