我有一个文件本地保存到应用程序的私有存储中。我已经验证它存在,但是每当我调用它时,BitmapFactory.decodeFile
它总是返回null
。
如果我将文件保存为资源并使用ImageView.setImageResource
,它总是显示得很好。
问题是什么?
这是片段:
filename = "test.png";
if (doesFileExist(filename))
Bitmap bMap = BitmapFactory.decodeFile(filename);
我也试过:
Bitmap bMap = BitmapFactory.decodeFile(getFilesDir().getPath()
+ filename);