- 在清单文件中定义内容提供者:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapp"> <application ...> <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example.myapp.fileprovider" android:grantUriPermissions="true" android:exported="false"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" /> </provider> ... </application> </manifest>
<paths> <files-path path="images/" name="myimages" /> </paths>
content://com.example.myapp.fileprovider/myimages/default_image.jpg
- andorid的NFC传输必须在版本4.1(16)以上才有用。
Sharing a File
最新推荐文章于 2021-12-14 10:51:01 发布