title: Getting bitmap from file path
body: <p>So the thing is that i want to get Bitmap from absolute path, so i pass those paths as <code>ArrayList&lt;Strings&gt;</code> to my presenter, where i have next piece of code: </p>
  
  <pre><code>private void decodeImageUri(final ArrayList&lt;String&gt; imageUris) {
  
      while(imageCounter &lt; imageUris.size()) {
          DecodeBitmapsThreadPool.post(new Runnable() {
              @Override
              public void run() {
  
                  Bitmap bitmap = BitmapFactory.decodeFile(imageUris.get(imageCounter));
  
                  mImagesBase64Array.add(bitmapToBase64(bitmap));
              }
          });
      }
      DecodeBitmapsThreadPool.finish();
      Log.d("SIZE OF BASE64", " ---------- " + mImagesBase64Array.size());
  
  }
  </code></pre>
  
  <p>And this is my ThreadPool class:</p>
  
  <pre><code>public class DecodeBitmapsThreadPool {
  
  private static DecodeBitmapsThreadPool mInstance;
  private ThreadPoolExecutor mThreadPoolExec;
  private static int MAX_POOL_SIZE;
  private static final int KEEP_ALIVE = 10;
  BlockingQueue&lt;Runnable&gt; workQueue = new LinkedBlockingQueue&lt;&gt;();
  
  public static synchronized void post(Runnable runnable) {
      if (mInstance == null) {
          mInstance = new DecodeBitmapsThreadPool();
      }
      mInstance.mThreadPoolExec.execute(runnable);
  }
  
  private DecodeBitmapsThreadPool() {
      int coreNum = Runtime.getRuntime().availableProcessors();
      MAX_POOL_SIZE = coreNum * 2;
      mThreadPoolExec = new ThreadPoolExecutor(
              coreNum,
              MAX_POOL_SIZE,
              KEEP_ALIVE,
              TimeUnit.SECONDS,
              workQueue);
  }
  
  public static void finish() {
      mInstance.mThreadPoolExec.shutdown();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>So when i start ThreadPool it looks like it get in some kind of a endless loop (according to Logcat) and then i just get OutOfMemoryException. I wonder what i`m i doing wrong, since i cant debug it. I simply want to decode the bitmap in background threads and create base64 representation of those Bitmaps, so i can upload them to the server. P.S. Any ideas how can this be implemented with RxJava2? Thanks in advance! </p>