我試圖用FileProvider
從私人path.Facing播放視頻安卓:FileProvider拋出:IllegalArgumentException無法找到配置的根包含/data/data/**/files/Videos/final.mp4
java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/XXXXX(Package)/files/Videos/final.mp4
代碼:
<paths>
<files-path path="my_docs" name="Videos/" />
</paths>
Java代碼:
File imagePath = new File(getFilesDir(), "Videos");
File newFile = new File(imagePath, "final.mp4");
Log.d(TAG, "-------------newFile:"+newFile.exists());//True here
//Exception in below line
Uri contentUri = FileProvider.getUriForFile(this,"com.wow.fileprovider", newFile);
Manifest.xml
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.wow.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
對此有何線索?
感謝 尼茨
我得到的「屬性丟失了Android命名空間前綴」在@ XML/file_paths同時實施Fileprovider..later不知何故,我結束了亂放的名稱和路徑,並結束了與此問題.. – NitZRobotKoder