Anand DR Anand DR - 3 months ago 20
Android Question

build a custom Share dialog as in Marshmallow

How to get the application label from ApplicaitonInfo class in android.
I need to get application label as in default share dialog that we get in Marshmallow.

Answer

The share dialog get the labels from the ResolveInfo object LINK.

It get those objects by calling:

List<ResolveInfo> targets = packageManager.queryIntentActivities(targetIntent, 0);

in the ResolveInfo you can get the label using:

resolveInfo.loadLabel(packageManager);
Comments