Android调用摄像头闪退

使用《第一行代码Android》一书中调用摄像头的代码时会闪退

原因在

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.launcher.cameramen.fierier"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
把 android:name="android.support.v4.content.FileProvider"改为
android:name="androidx.core.content.FileProvider"就可以了

posted on 2019-12-24 16:36  空理彷徨的程序世界  阅读(901)  评论(0)    收藏  举报

导航