android中读取assets中的文件
程序员文章站
2022-07-01 16:06:28
...
private Bitmap getImageFromAssetFile(String fileName){ Bitmap image = null; try{ AssetManager am = context.getAssets(); InputStream is = am.open(fileName); image = BitmapFactory.decodeStream(is); is.close(); }catch(Exception e){ } return image; }
InputStream in = getResources().getAssets().open(fileName);
上一篇: java
下一篇: 支持注解的Servlet3.0监听器