使用ContentProvider所要注意的细节

1.在要暴露信息的应用中

MndroidManifest清单文件中配置<provider>时除了配置name和authorities以外,还要配置exported,并且值要等于true

,系统默认的值是false,如果是false的话,信息将不能被其他应用读取或操作,所以要打开数据交流的权限,让值等于true。

<provider

            android:name="com.example.e5.sqlite.PersonContentProvider"
            android:exported="true"
            android:authorities="com.example.e5.sqlite.persondb"
            ></provider>

 2.

posted @ 2016-07-14 09:34  YBOLi  阅读(359)  评论(0编辑  收藏  举报