使用ContentProvider时出现SecurityException: Permission Denial: opening provider

1 <provider
2             android:authorities="allen.com.sqltest.provider"
3             android:name="allen.com.sqltest.SqlProvider"
4             android:exported="true">
5 </provider>

如上述代码,需加入 android:exported = "true"这一句,这样做的原因是:Android4.3以前,exported的默认值时true,而4.3往后,默认值为false。

原文地址:https://www.cnblogs.com/hua-hahaha/p/4403428.html