title: Throwing Runntime Error Using Universal Image Loader Library
body: <p>Hello Friend I am Using Universal Image Loader To Slide Image From Json 
  But I don't know Why its Giving Illegal Argument </p>
  
  <p>here Is my Code Debugger jump to error </p>
  
  <pre><code>if (result != null) {
      if (products != null &amp;&amp; products.size() != 0) {
  
          mViewPager.setAdapter(new ImageSlideAdapter(
              activity, products, HomeFragment.this));
  
          mIndicator.setViewPager(mViewPager);
          imgNameTxt.setText(""
                  + ((Product) products.get(mViewPager
                          .getCurrentItem())).getName());
          runnable(products.size());
          handler.postDelayed(animateViewPager,
                  ANIM_VIEWPAGER_DELAY);
      } 
  </code></pre>
  
  <p>the error is  on the </p>
  
  <pre><code>        mViewPager.setAdapter(new ImageSlideAdapter(
              activity, products, HomeFragment.this));
  </code></pre>
  
  <p>And Here Is My Slideradaptor Class</p>
  
  <pre><code>public class ImageSlideAdapter extends PagerAdapter {
      ImageLoader imageLoader = ImageLoader.getInstance();
      DisplayImageOptions options;
      private ImageLoadingListener imageListener;
      FragmentActivity activity;
      List&lt;Product&gt; products;
      HomeFragment homeFragment;
  
      public ImageSlideAdapter(FragmentActivity activity, List&lt;Product&gt; products,
              HomeFragment homeFragment) {
          this.activity = activity;
          this.homeFragment = homeFragment;
          this.products = products;
          options = new DisplayImageOptions.Builder()
                  .showImageOnFail(R.drawable.ic_error)
                  .showStubImage(R.drawable.ic_launcher)
                  .showImageForEmptyUri(R.drawable.ic_empty).cacheInMemory()
                  .cacheOnDisc().build();
  
          imageListener = new ImageDisplayListener();
      }
  
      @Override
      public int getCount() {
          return products.size();
      }
  
      @Override
      public View instantiateItem(ViewGroup container, final int position) {
          LayoutInflater inflater = (LayoutInflater) activity
                  .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
          View view = inflater.inflate(R.layout.vp_image, container, false);
  
          ImageView mImageView = (ImageView) view
                  .findViewById(R.id.image_display);
          mImageView.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  /*Bundle arguments = new Bundle();
                  Fragment fragment = null;
                  Log.d("position adapter", "" + position);
                  Product product = (Product) products.get(position);
                  arguments.putParcelable("singleProduct", product);
  
                  // Start a new fragment
                  fragment = new ProductDetailFragment();
                  fragment.setArguments(arguments);
  
                  FragmentTransaction transaction = activity
                          .getSupportFragmentManager().beginTransaction();
                  transaction.replace(R.id.content_frame, fragment,
                          ProductDetailFragment.ARG_ITEM_ID);
                  transaction.addToBackStack(ProductDetailFragment.ARG_ITEM_ID);
                  transaction.commit();*/
              }
          });
          imageLoader.displayImage(
                  ((Product) products.get(position)).getImageUrl(), mImageView,
                  options, imageListener);
          container.addView(view);
          return view;
      }
  
      @Override
      public void destroyItem(ViewGroup container, int position, Object object) {
          container.removeView((View) object);
      }
  
      @Override
      public boolean isViewFromObject(View view, Object object) {
          return view == object;
      }
  
      private static class ImageDisplayListener extends
              SimpleImageLoadingListener {
  
          static final List&lt;String&gt; displayedImages = Collections
                  .synchronizedList(new LinkedList&lt;String&gt;());
  
          @Override
          public void onLoadingComplete(String imageUri, View view,
                  Bitmap loadedImage) {
              if (loadedImage != null) {
                  ImageView imageView = (ImageView) view;
                  boolean firstDisplay = !displayedImages.contains(imageUri);
                  if (firstDisplay) {
                      FadeInBitmapDisplayer.animate(imageView, 500);
                      displayedImages.add(imageUri);
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Please Tell Me Where I m Doing Wrong </p>
  
  <p>and My Logcat Giving ME </p>
  
  <pre><code>02-12 10:54:05.522: E/AndroidRuntime(1195): java.lang.IllegalStateException: ImageLoader must be init with configuration before using
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at com.nostra13.universalimageloader.core.ImageLoader.checkConfiguration(ImageLoader.java:340)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at com.nostra13.universalimageloader.core.ImageLoader.displayImage(ImageLoader.java:179)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at com.wie.trandyclothing.services.ImageSlideAdapter.instantiateItem(ImageSlideAdapter.java:89)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at com.wie.trandyclothing.services.ImageSlideAdapter.instantiateItem(ImageSlideAdapter.java:1)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:837)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.support.v4.view.ViewPager.populate(ViewPager.java:987)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.support.v4.view.ViewPager.populate(ViewPager.java:919)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.support.v4.view.ViewPager.setAdapter(ViewPager.java:447)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at    com.wie.trandyclothing.HomeFragment$RequestImgTask.onPostExecute(HomeFragment.java:291)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at com.wie.trandyclothing.HomeFragment$RequestImgTask.onPostExecute(HomeFragment.java:1)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.os.AsyncTask.finish(AsyncTask.java:631)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.os.AsyncTask.access$600(AsyncTask.java:177)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.os.Handler.dispatchMessage(Handler.java:99)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.os.Looper.loop(Looper.java:137)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at android.app.ActivityThread.main(ActivityThread.java:4745)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-12 10:54:05.522: E/AndroidRuntime(1195):     at java.lang.reflect.Method.invoke(Method.java:511)
  </code></pre>