private Bitmap loadImageFile(final String filename, final AssetManager manager) { InputStream is = null; try { Bitmap bmp = null; // Bitmap bmp = BitmapCache.getInstance().getBitmap(filename, // param.getAssetManager()); BufferedInputStream buf; try { buf = new BufferedInputStream(param.getAssetManager().open(filename)); bmp = BitmapFactory.decodeStream(buf); } catch (IOException e) { e.printStackTrace(); } return bmp; } catch (Exception e) { Log.e(this.getClass().getSimpleName(), "fetchDrawable failed", e); } finally { try { if (is != null) is.close(); } catch (IOException e) { e.printStackTrace(); } } return null; }
@Override protected Bitmap doInBackground(WaterfallFlowTag... params) { param = params[0]; return loadImageFile(param.getFileName(), param.getAssetManager()); }