title: ViewPager Glide
body: <p>I have ViewPager(Slide) and have 3 image. There are three images that are downloaded over the Internet. If I change the picture to another server on the server, the link remains the same, but the picture in the application does not change and remains the same one that was in the cache</p>
  
  <pre><code>public class ViewPagerAdapter extends PagerAdapter {
  
      private Context context;
      private LayoutInflater layoutInflater;
      private String [] image = {"http://rgho.st/7hDcbyT2F/image.png",
              "http://guid-korenovsk.my1.ru/logos.png",
              "https://4.bp.blogspot.com/-JKogH2VCCoY/V_aZWCFsmtI/AAAAAAAABAA/Lu6D13VXGSMMnYFO8T8-pKDeqbkHhNRAwCLcB/s320/VideoThumbail.PNG"};
  
  
  
      public ViewPagerAdapter(Context context) {
          this.context = context;
      }
  
      @Override
      public int getCount() {
          return image.length;
      }
  
      @Override
      public boolean isViewFromObject(View view, Object object) {
          return view == object;
      }
  
      @Override
      public Object instantiateItem(ViewGroup container, int position) {
         layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View view = layoutInflater.inflate(R.layout.bulding_layout, null);
          ImageView imageView = (ImageView)view.findViewById(R.id.imageViewPager);
  
          Glide.with(context)
                  .load(image[position])
                  .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                  .into(imageView);
  
  
  
  
  
  
  
          ViewPager vp = (ViewPager)container;
          vp.addView(view,0);
          return view;
      }
  
      @Override
      public void destroyItem(ViewGroup container, int position, Object object) {
          ViewPager vp = (ViewPager)container;
          View view = (View)object;
          vp.removeView(view);
      }
  
  }
  
   public class MyTimerTask extends TimerTask {
  
          @Override
          public void run() {
             getActivity().runOnUiThread(new Runnable() {
                  @Override
                  public void run() {
                      if(viewPagerAds.getCurrentItem() == 0){
                          viewPagerAds.setCurrentItem(1);
                      }else if(viewPagerAds.getCurrentItem() == 1){
                          viewPagerAds.setCurrentItem(2);
                      }else viewPagerAds.setCurrentItem(0);
                  }
              });
          }
      }
  </code></pre>