-
public class ActivityCompat
-
-
Method Summary
Modifier and Type Method Description static UrigetReferrer(@Nullable() Activity activity)Return information about who launched this activity. static UrigetReferrerFromIntent(@Nullable() Intent intent)Return information about who launched this activity. -
-
Method Detail
-
getReferrer
@Nullable() static Uri getReferrer(@Nullable() Activity activity)
Return information about who launched this activity. If the launching Intentcontains an Intent.EXTRA_REFERRER,that will be returned as-is; otherwise, if known, an android-app: referrer URI containing thepackage name that started the Intent will be returned. This may return null if noreferrer can be identified -- it is neither explicitly specified, nor is it known whichapplication package was involved.
If called while inside the handling of onNewIntent, this function willreturn the referrer that submitted that new intent to the activity. Otherwise, italways returns the referrer of the original Intent.
Note that this is not a security feature -- you can not trust thereferrer information, applications can spoof it.
-
getReferrerFromIntent
@Nullable() static Uri getReferrerFromIntent(@Nullable() Intent intent)
Return information about who launched this activity. If the launching Intentcontains an Intent.EXTRA_REFERRER or EXTRA_REFERRER_NAME,that will be returned as-is; otherwise will return null.
Since intent is used directly it is guarantied that mReferrer field of Activity will not be used,opposed to implementation of getReferrer. Though, it is still possible to getan android-app: referrer URI containing thepackage name that started the Intent if it is provided as intent extra.
-
-
-
-