即使文件存在,Drawable createFromPath也返回null

时间:2014-04-09 13:36:26

标签: java android drawable

d = Drawable.createFromPath(Environment.getExternalStorageDirectory().toString()+"/"+filenameString);
System.err.println(Environment.getExternalStorageDirectory().toString()+"/"+filenameString+"  -  "+d);
image.setImageDrawable(d);

以上是我用于获取drawable且低于Logcat的代码:

04-09 15:34:44.005: I/System.out(20814): Not a DRM File, opening notmally
04-09 15:34:44.010: I/System.out(20814): buffer returned 
04-09 15:34:44.010: D/skia(20814): --- SkImageDecoder::Factory returned null
04-09 15:34:44.010: W/System.err(20814): /storage/sdcard0/1396850896.482724.png
04-09 15:34:44.010: W/System.err(20814):   -  null

我检查过,文件存在。

我设置了 WRITE_EXTERNAL_STORAGE READ_EXTERNAL_STORAGE

0 个答案:

没有答案