You need to implement your own dialogue to select activity.
To create such dialogs, you need to use PackageManager.queryIntentActivities()
. This method returns a List<ResolveInfo>
.
ResolveInfo
contains some information about the activity (for example, resolveInfo.activityInfo.packageName
), and using PackageManager you can get other information (useful for displaying activity in the dialog box) - application shortcut, application shortcut, etc.
Display the results in a list in a dialog box (or as an action as a dialog). When the item is clicked, create a new Intent.ACTION_SEND
, add the desired content and add the package of the selected intent.setPackage(pkgName)
.
source share