Devansh Gupta
Devansh Gupta

Reputation: 275

Android Intent Data Uri Query Parameter

I am trying to launch my app using an intent like this:

adb shell am start -a android.intent.action.VIEW -d "my_scheme://my_host?queryParam1=QueryParam1&queryParam2=QueryParam2"

(I have registered for the data intent filter with scheme "my_app_scheme" and host "my_host")

But when I do

getIntent().getData()

all I get is the URI

"my_scheme://my_host?queryParam1=QueryParam1"

Only the first ever query param is set in the getIntent().getData(). Do you know why that might be? And how do I fix it?

Upvotes: 20

Views: 6139

Answers (1)

keithrel
keithrel

Reputation: 321

Try it by escaping the ampersand '&' using a '\'

adb shell am start -a android.intent.action.VIEW -d "my_scheme://my_host?queryParam1=QueryParam1\&queryParam2=QueryParam2"

Upvotes: 25

Related Questions