getShareTarget

open fun getShareTarget(@NonNull context: Context, @NonNull shareAction: ShareAction, @NonNull targetPackageName: String): ShareTarget

Creates ShareTarget for given shareAction and targetPackageName.

Return

ShareTarget with data resolved from package manager or null if could not be resolved.

Parameters

context

The context to use.

shareAction

Share action to create share target for.

targetPackageName

Package name of share target.


open fun getShareTarget(@NonNull context: Context, @NonNull shareAction: ShareAction, @NonNull targetPackageName: String, @Nullable sharedFileName: String): ShareTarget

Creates ShareTarget for given shareAction and targetPackageName.

Return

ShareTarget with data resolved from package manager or null if could not be resolved.

Parameters

context

The context to use.

shareAction

Share action to create share target for.

targetPackageName

Package name of share target.

sharedFileName

File name of the file that should be shared.