Package 

Class ActivityCompat

    • Method Summary

      Modifier and Type Method Description
      static Uri getReferrer(@Nullable() Activity activity) Return information about who launched this activity.
      static Uri getReferrerFromIntent(@Nullable() Intent intent) Return information about who launched this activity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.