Android应用程序:如何读取自定义URL方案得到参数? [英] Android App: How to read get parameters from a custom url scheme?

查看:174
本文介绍了Android应用程序:如何读取自定义URL方案得到参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我有描述为<一个同样的问题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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆