Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android App: How to read get parameters from a custom url scheme?

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?

like image 385
Timo Ernst Avatar asked Jun 12 '13 10:06

Timo Ernst


1 Answers

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

like image 105
CommonsWare Avatar answered Oct 16 '22 18:10

CommonsWare