title: How does one use glide to download an image into a drawable?
body: <p>I have learning Image Slider Using ViewPager. For that, I want the images to be dynamic. Glide is easy but I think I am not using it properly. 
  Here's what I am trying to do.</p>
  
  <pre><code>//Initialize by default Images
  private static final Integer[] IMAGES = {R.drawable.image1,R.drawable.image2};
  
  // Load images into Drawables using Glide 
          Glide.with(this)
                  .load("https://google.com/someImage1.jpg")
                    .error(R.drawable.image1)
                    .into(R.drawable.image1);
          Glide.with(this)
                  .load("https://google.com/someImage2.jpg")
                    .error(R.drawable.image2)
                    .into(R.drawable.image2);
  
  // Set Again
   IMAGES[0]= R.drawable.image1;
   IMAGES[1]= R.drawable.image2;
  </code></pre>
  
  <p>But <code>.into(java.lang.Integer</code>) is not defined and I know that. But I want something that would solve my problem. I have slider view. In that I need to pass the Images as drawables or something like that. Image loading would be carried by Adapter. I can't load directly as far as I know.  Is there any way to load glide images in <code>drawable</code>. </p>
  
  <p>Also what is the best way to catch or store the images locally, so that if there is no internet connection, still the slider works smoothly. </p>
  
  <p>Here is my Adapater</p>
  
  <pre><code>public class MainPageSlideImageAdapter extends PagerAdapter {
      private ArrayList&lt;Integer&gt; IMAGES;
      private LayoutInflater inflater;
      private Context context;
  
  
      public MainPageSlideImageAdapter(Context context,ArrayList&lt;Integer&gt; IMAGES) {
          this.context = context;
          this.IMAGES=IMAGES;
          inflater = LayoutInflater.from(context);
      }
  
      @Override
      public void destroyItem(ViewGroup container, int position, Object object) {
          container.removeView((View) object);
      }
  
      @Override
      public int getCount() {
          return IMAGES.size();
      }
  
      @Override
      public Object instantiateItem(ViewGroup view, int position) {
          View imageLayout = inflater.inflate(R.layout.main_page_slidingimages, view, false);
  
          assert imageLayout != null;
          final ImageView imageView = (ImageView) imageLayout
                  .findViewById(R.id.image);
  
          imageView.setImageResource(IMAGES.get(position));
          view.addView(imageLayout, 0);
  
          return imageLayout;
      }
  
      @Override
      public boolean isViewFromObject(View view, Object object) {
          return view.equals(object);
      }
  
      @Override
      public void restoreState(Parcelable state, ClassLoader loader) {
      }
  
      @Override
      public Parcelable saveState() {
          return null;
      }
  
  }
  </code></pre>