0

After setting up an app for deep linking. by creating an activity to launch when the link is opened in the browser. How do I go about getting the link that the browser used to start the intent?

Let us say the app catches the URL: "https://example.com/foo/bar?param=1&data=extra". In the Activity launched I want to use the URL which opened the app. I am thinking maybe something like int the activity perform

Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();

I dont know the variable to access the lauch URL from Uri data

Bret Joseph
  • 401
  • 3
  • 13

1 Answers1

1

It turns out I was on the right track all I do is

    data.getQuery();

To get the last part of "https://example.com/foo/bar?param=1&data=extra" ie "param=1&data=extra"

Otherwise, call another function of data like.function() to get other aspects of the URI eg the whole URL that led to the opening of the activity

Stackoverflow makes you think half the time I always find the answer Immediately after I post a question.

Bret Joseph
  • 401
  • 3
  • 13