title: How can I get bitmap using glide in onCreate?
body: <p>I'm using <strong>MVVM</strong> model. So what I have to do is first, getting datas containing URLs and others from retrofit.</p>
  
  <p>Second is getting images from URLs and notifying <strong>Viewpager</strong> after first process.
  I did the first. but when I try the second process, the error occurred</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: You must call this method on a
    background thread</p>
  </blockquote>
  
  <p>I referred this site <a href="http://bumptech.github.io/glide/doc/getting-started.html#background-threads" rel="nofollow noreferrer">http://bumptech.github.io/glide/doc/getting-started.html#background-threads</a>
  to use glide on background thread. </p>
  
  <p>I don't have to use <strong>Asynctask</strong> in observe that is my constraint to develop. How can I solve the second process?  </p>
  
  <pre><code> detailViewModel.getIndexItem().observe(this, Observer&lt;DetailModel&gt;(){  
                  t-&gt;
  
              binding.item = t
  
              image_list = binding.item.thumbnail_list_320.toString().split("#")
              for(image in image_list) {
                  val futureTarget: FutureTarget&lt;Bitmap&gt; = Glide.with(context)
                      .asBitmap()
                      .load(image)
                      .submit(500, 500)
  
                  val bitmap = futureTarget.get()
                  bitmaps.add(bitmap).apply {
                      if(this){
                          viewPagerAdapter.notifyDataSetChanged()
                          transitionLayout.visibility=View.GONE                             
                          detailLayout.visibility=View.VISIBLE
                      }
                  }
              }
          })
  </code></pre>