【发布时间】:2016-06-18 20:14:28
【问题描述】:
您好,我正在开发包含 assets 文件夹的 android 应用程序。在资产文件夹中,我放了 abc.pdf。但是当我尝试访问该文件时,它显示文件不存在。我尝试了以下方式。
File pdfFile = new File("file:///android_asset/"+ "abc.pdf");
if(!pdfFile.exists()){
Toast.makeText(this, "not there", Toast.LENGTH_SHORT).show();
return;
}
else
{
Toast.makeText(this, "it's there", Toast.LENGTH_SHORT).show();
}
我做错了吗?需要一些帮助。谢谢。
【问题讨论】: