title: Put images into listarray from assets folder
body: <p>I want put bitmap image to ListView,</p>
  
  <p>I use this method:</p>
  
  <pre><code>    public Drawable getAssetImage(Context context, String filename) throws IOException {
      AssetManager assets = getAssets();
      InputStream buffer = new BufferedInputStream((assets.open("flags/" + filename + ".png")));
      Bitmap bitmap = BitmapFactory.decodeStream(buffer);
      return new BitmapDrawable(bitmap);
  }
  </code></pre>
  
  <p>and then, I put into hashmap:</p>
  
  <pre><code>temp.put("Icon", getAssetImage(this, "Cyprus"));
  </code></pre>
  
  <p>I have my icons in assets/flags</p>
  
  <p>here we have error log:</p>
  
  <pre><code>    06-13 12:39:12.236: ERROR/AndroidRuntime(10934): FATAL EXCEPTION: main
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934): java.lang.NullPointerException
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.content.ContextWrapper.getResources(ContextWrapper.java:80)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at com.project.castroll.DataBaseHelper.getAssetImage(DataBaseHelper.java:111)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at com.project.castroll.DataBaseHelper.selectAll(DataBaseHelper.java:96)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at com.project.castroll.CastrollApp.showKwalifikacja(CastrollApp.java:282)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at com.project.castroll.CastrollApp$2.onClick(CastrollApp.java:255)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.view.View.performClick(View.java:2485)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.view.View$PerformClick.run(View.java:9080)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.os.Handler.handleCallback(Handler.java:587)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.os.Handler.dispatchMessage(Handler.java:92)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.os.Looper.loop(Looper.java:123)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at java.lang.reflect.Method.invokeNative(Native Method)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at java.lang.reflect.Method.invoke(Method.java:507)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  06-13 12:39:12.236: ERROR/AndroidRuntime(10934):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>