此代码始终返回null
String path = "file:///android_asset/image.png";
Drawable d = null;
try {
d = Drawable.createFromStream(ContextHolder.getActivity().getAssets().open(path), null);
} catch(Exception e) {
}
答案 0 :(得分:2)
Drawable d = Drawable.createFromStream(getAssets().open("image.png"), null);
答案 1 :(得分:2)
路径错误
String path = "image.png";