質問

This code always returns null

String path = "file:///android_asset/image.png";
Drawable d = null;
try {
     d = Drawable.createFromStream(ContextHolder.getActivity().getAssets().open(path), null);
} catch(Exception e) {

}
役に立ちましたか?

解決

The path is wrong

String path = "image.png";

他のヒント

Drawable d = Drawable.createFromStream(getAssets().open("image.png"), null);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top