1

我在 android 文档中发现这Uri是一个

标识抽象或物理资源的统一资源标识符,由 RFC 2396 指定。

当我想从我的 android 应用程序中拨打电话时,意图如下所示:

String toDial="tel:"+number.getText().toString();
Intent i = new Intent(Intent.ACTION_DIAL,Uri.parse(toDial));

在这种情况下,物理或抽象资源是什么?

4

2 回答 2

3

电话号码的 URI 记录在 RFC 3966 中

https://www.rfc-editor.org/rfc/rfc3966

URI可以指电话号码标识的资源,包括但不限于电话呼叫的发起者或目标。

于 2012-05-12T04:12:48.797 回答
1

see Uri syntax from following link:

http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax

note syntax:

<scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]

Here scheme name defines what type of Uri it is: it may have options http, mailto, tel, etc.

next is hierarchical part, which may have information into hierarchy. As number does not have fragments or queryl, its only part avaialable for this URI.

于 2012-05-12T04:20:56.907 回答