Android应用程序:如何读取自定义URL方案得到参数? [英] Android App: How to read get parameters from a custom url scheme?
问题描述
基本上,我有描述为<一个同样的问题href="http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-schema-on-android">How实现我自己在Android URI方案
Basically, I have the same question described as in How to implement my very own URI scheme on Android
还有给出的答案为我工作。当自定义网址被称为 MyUriActivity的
方法的onCreate
和 ONSTART
被调用。
The answer given there works for me. When the custom url is called MyUriActivity's
methods onCreate
and onStart
are called.
但
如何从访问中 MyUriActivity
?
例如:
的myapp://路径/要/什么/我/想D =此%20是%20A%20test
在 MyUriActivity
我需要阅读的GET参数 D
。
In MyUriActivity
I need to read the value of get parameter d
.
我该怎么办呢?
推荐答案
呼叫 getIntent()的getData()
来检索的的乌里
,然后调用 getQueryParameter(D)
来获取 D
。
Call getIntent().getData()
to retrieve the Uri
, then call getQueryParameter("d")
to get the value of d
.
这篇关于Android应用程序:如何读取自定义URL方案得到参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!