![](/img/trans.png)
[英]How to create a new folder inside the drawable folder and reference an image from it?
[英]How to create a drawable from an image in assets folder?
此代碼始終返回null
String path = "file:///android_asset/image.png";
Drawable d = null;
try {
d = Drawable.createFromStream(ContextHolder.getActivity().getAssets().open(path), null);
} catch(Exception e) {
}
Drawable d = Drawable.createFromStream(getAssets().open("image.png"), null);
路徑錯了
String path = "image.png";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.