Android.App.Activity.CallingPackage Property
Return the name of the package that invoked this activity.

Syntax

[get: Android.Runtime.Register("getCallingPackage", "()Ljava/lang/String;", "GetGetCallingPackageHandler")]
public virtual string CallingPackage { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Return the name of the package that invoked this activity. This is who the data in Activity.SetResult(Result) will be sent to. You can use this information to validate that the recipient is allowed to receive the data.

Note: if the calling activity is not expecting a result (that is it did not use the Activity.StartActivityForResult(Android.Content.Intent, System.Int32) form that includes a request code), then the calling package will be null.

Note: prior to NoType:android/os/Build$VERSION_CODES;Href=../../../reference/android/os/Build.VERSION_CODES.html#JELLY_BEAN_MR2, the result from this method was unstable. If the process hosting the calling package was no longer running, it would return null instead of the proper package name. You can use Activity.CallingActivity and retrieve the package name from that instead.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1