Android 中URI authority 和URI scheme 有什么区别? 我总是在 URI 中使用方案来指示数据库表,如下所示:
content://scheme
我在我的应用程序中使用自定义搜索建议,我阅读了有关搜索自定义建议的文档,其中使用授权而不是方案来引用数据库,如下所示:
content://your.authority/opthional.suggest.path/SUGGEST_URI_PATH_QUERY
上面的my.authority
是什么?这个和scheme有什么区别?
最佳答案
i always use scheme in uri to indicate database table as follow
content://scheme
scheme
不是计划。 content
是方案,遵循the rules for URI values .你有什么 scheme
Android content://
是什么Uri
被称为权威。
what is my.authoruty above ?
是权威。它需要在 android:authorities
中<provider>
的属性在您的 list 中,Android 使用它来找到一个真正的 ContentProvider
对于任何 Uri
.
what is the difference between this and scheme ?
它们是相同的,因为您误用了“方案”一词。
关于android - Android URI 中 authority 和 scheme 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30710046/