问题描述
我一直在尝试与自定义内容提供商合作,但我有几个问题.
I've been trying to work on a custom content provider and I have a few questions.
-
Android框架如何使用Authority属性?为什么要求在清单中声明它,类名不够吗?
How is the Android framework using Authority property? Why is it required to declare it in the manifest, shouldn't the class name be enough?
谁/哪个进程在ContentProvider实现中调用getType()方法?
Who/what process calls the getType() method in the ContentProvider implementation?
urimatcher需要什么?如果基础数据库只有几个表,应该使用它吗?
What is the need of the urimatcher? Should it be used if the underlying database has only a handful of tables?
推荐答案
您需要在清单中声明它,因为在市场"条目中列出了数据访问权限.IE.具有阅读联系信息的权限".
You are required to declare it in the manifest because data access permissions are listed in the Market entry. I.E. "Has permission to read contact information".
getType()
.当您使用 MyContentProvider.getType(myUri)
希望这会有所帮助!
这篇关于内容提供者,权限和URI匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!