Sdílet prostřednictvím


Activity.Referrer Property

Definition

Return information about who launched this activity.

public virtual Android.Net.Uri? Referrer { [Android.Runtime.Register("getReferrer", "()Landroid/net/Uri;", "GetGetReferrerHandler", ApiSince=22)] get; }
[<get: Android.Runtime.Register("getReferrer", "()Landroid/net/Uri;", "GetGetReferrerHandler", ApiSince=22)>]
member this.Referrer : Android.Net.Uri

Property Value

Uri
Attributes

Remarks

Return information about who launched this activity. If the launching Intent contains an android.content.Intent#EXTRA_REFERRER Intent.EXTRA_REFERRER, that will be returned as-is; otherwise, if known, an Intent#URI_ANDROID_APP_SCHEME android-app: referrer URI containing the package name that started the Intent will be returned. This may return null if no referrer can be identified -- it is neither explicitly specified, nor is it known which application package was involved.

If called while inside the handling of #onNewIntent, this function will return the referrer that submitted that new intent to the activity. Otherwise, it always returns the referrer of the original Intent.

Note that this is <em>not</em> a security feature -- you can not trust the referrer information, applications can spoof it.

Java documentation for android.app.Activity.getReferrer().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to