35

Basically, I have the same question described as in How to implement my very own URI scheme on Android

The answer given there works for me. When the custom url is called MyUriActivity's methods onCreate and onStart are called.

BUT

How can I access the get parameters from within MyUriActivity?

Example:

myapp://path/to/what/i/want?d=This%20is%20a%20test

In MyUriActivity I need to read the value of get parameter d.

How do I do that?

Community
  • 1
  • 1
Timo Ernst
  • 15,243
  • 23
  • 104
  • 165

1 Answers1

103

Call getIntent().getData() to retrieve the Uri, then call getQueryParameter("d") on it to get the value of d.

Daniels Šatcs
  • 526
  • 6
  • 18
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491