fileprovider external-files-path共享为空

时间:2018-01-21 14:03:22

标签: android android-fileprovider

我看到很多代码和示例,但我的应用程序还没有正常工作, 我想分享我的图像  SERVER_NAME个文件夹就像  /storage/emulated/0/Android/data/ir.esfandune.mohsen/files/Download/,我在清单中定义提供者:

/storage/emulated/0/Android/data/ir.esfandune.mohsen/files/Download/cnt_imags/images/n1/n1 (18).jpg

和XML:

enter image description here

我的代码是:

 <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="${applicationId}"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
    </provider>

但是当发送到其他应用时,请不要分享任何内容

1 个答案:

答案 0 :(得分:2)

您创建了Uri,然后您没有做任何事情。对于ACTION_SEND,您将Uri附加为EXTRA_STREAM附加内容。

有关详情,请参阅the documentation

相关问题