Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.res.XmlResourceParser android.content.pm.PackageItemInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)’ on a null object refer
使用Android 7(24)拍照的时候,需要使用FileProvide 调用系统的拍照
使用方式如下 FileProvider 的使用(http://blog.csdn.net/black_bread/article/details/69258613)`
但是一不小心就出现以上的NullPointerException ,为什么呢?
如来在清单文件Manifest中的provider配置需要主要
<provider
android:name="android.support.v4.content.FileProvider"
**android:authorities="com.xiaodou.smarthousekeeper.fileprovider"**
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
axmlndroid:resource="@xml/filepaths"/>
</provider>
注意authorities 部分必须是全路径名字,而不能使用. 代替应用的包名