简体   繁体   English

Android中Content Provider Uri中的“ content://”是否可以替换?

[英]is “content://” in the Uri of Content Provider in Android replaceable ?

In our platform, we use a certain format from paths. 在我们的平台上,我们使用路径中的某种格式。 In the Android App, it receives those paths to load some data or do something. 在Android应用中,它会接收这些路径以加载一些数据或执行某些操作。

I want to do all the data handling using content provider, I want to give the path and get data. 我想使用内容提供程序进行所有数据处理,我想给出路径并获取数据。 A simple transaction. 一个简单的交易。

When I read into content providers, the documentation and all the tutorials out there always use "content://" at the beginning. 当我阅读内容提供者时,文档和那里的所有教程始终在开头始终使用“ content://”。 However, I want to use our own start of the path which is usually "is-://". 但是,我想使用我们自己的路径开始,通常为“ is-://”。 Can something like this work? 这样的事情可以工作吗?

no, this is how the system categorize the uri as content provider. 不,这是系统将uri归类为内容提供者的方式。 its like relacing file:// with something else. 就像用其他东西代替file://一样。

After referring to Developer.google site 在参考Developer.google网站之后

A content URI is a URI that identifies data in a provider. 内容URI是标识提供者中数据的URI。 Content URIs include the symbolic name of the entire provider (its authority) and a name that points to a table (a path). 内容URI包括整个提供程序的符号名称(其权限)和指向表的名称(路径)。 When you call a client method to access a table in a provider, the content URI for the table is one of the arguments. 当您调用客户端方法来访问提供程序中的表时,表的内容URI是参数之一。

From this I believe you can't set it on your own as it includes the symbol name. 因此,我相信您不能自己设置它,因为它包括符号名称。

Also why do you want to change it? 还为什么要更改它?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM