使用 WebViewer 文件夹中的 Android 示例,我在 Android Studio 中有一个应用程序,当它在我的设备上运行时,它可以正常工作并按预期显示给定的 xod 文件。但是我试图改变线路:
String documentPath = getFilesDir().getPath() + "/GettingStarted.xod";
InputStream in = getAssets().open("xod/GettingStarted.xod");
到
String documentPath = getFilesDir().getPath() + "/sample.pdf";
InputStream in = getAssets().open("xod/sample.pdf");
并且还将endsWith(".xod") 更改为endsWith(".pdf") 但我只得到一个灰屏。为此,文件必须是 .xod 吗?因为它适用于 xod 文件,但不适用于 pdf 文件。
谢谢你的时间。