Android Intent Data Uri Query Parameter

2019-04-04 14:48发布

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?

1条回答
Juvenile、少年°
2楼-- · 2019-04-04 15:26

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"
查看更多
登录 后发表回答