Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 523
Devansh Gupta Avatar asked Apr 07 '14 19:04

Devansh Gupta


1 Answers

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"
like image 109
keithrel Avatar answered Nov 04 '22 14:11

keithrel