美文网首页
使用知乎的Matisse遇到的坑

使用知乎的Matisse遇到的坑

作者: 我才是张雷 | 来源:发表于2017-07-19 14:07 被阅读0次

Matisse集成及属性参考Matisse

使用相机必须指定

 Matisse.from(SampleActivity.this)
  .capture(true)
  .captureStrategy(new CaptureStrategy(true, "com.thunder.sample.fileprovider"))

manifest里必须指定provider

 <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="com.thunder.sample.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths_public"></meta-data>
</provider>

res里新建个包xml里新建个file_paths_public.xml文件

<paths>
    <external-path
        name="my_images"
        path="Android/data/com.thunder.sample.fileprovider/files/Pictures"/>
</paths>

注意:这三个里面的com.thunder.sample.fileprovider这值是一致的

相关文章

网友评论

      本文标题:使用知乎的Matisse遇到的坑

      本文链接:https://www.haomeiwen.com/subject/wwjlkxtx.html