title: How to display gif loader till image is loaded in GridItem in android
body: <p>I have a GridView,I am setting images using my adapter,I have used Universal Image Loader library for loading images from the url,Now all is going good,But i want to put a gif loader to background of each grid item ,till the image in that particular gridItem is not loaded,can any buddy please suggest me how can i do this,My code is as below:</p>
  
  <p><strong>adapter code</strong></p>
  
  <pre><code>package com.eps.fortalented.adapter;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Color;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.ViewGroup.LayoutParams;
  import android.widget.BaseAdapter;
  import android.widget.ImageView;
  import android.widget.RelativeLayout;
  
  import com.eps.fortalented.R;
  import com.eps.fortalented.uc.GifWebView;
  import com.nostra13.universalimageloader.core.DisplayImageOptions;
  import com.nostra13.universalimageloader.core.ImageLoader;
  import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
  
  public class photosTalentAdapter extends BaseAdapter {
      public ArrayList&lt;HashMap&lt;String, String&gt;&gt; photoArray;
      private Context mContext;
      private DisplayImageOptions options;
      public static ImageLoader imageLoader;
      String photoImg;
      String query = "http://test.fortalented.com/manage/";
      Intent i;
      String camera, description, captured_date, date_modified, category,
              date_added, candidate_name, big_img;
      GifWebView view;
  
      @SuppressWarnings({ "deprecation" })
      public photosTalentAdapter(Context paramContext,
              ArrayList&lt;HashMap&lt;String, String&gt;&gt; photoList) {
          this.mContext = paramContext;
          this.photoArray = photoList;
          imageLoader = ImageLoader.getInstance();
          imageLoader.init(ImageLoaderConfiguration.createDefault(paramContext));
  
          options = new DisplayImageOptions.Builder().cacheOnDisc(true)
                  .showStubImage(R.drawable.noimage)
                  .showImageOnFail(R.drawable.noimage).build();
  
          // New
  
      }
  
      public int getCount() {
          return this.photoArray.size();
      }
  
      public Object getItem(int paramInt) {
          return Integer.valueOf(paramInt);
      }
  
      public long getItemId(int paramInt) {
          return paramInt;
      }
  
      public View getView(final int paramInt, View paramView,
              ViewGroup paramViewGroup) {
          LayoutInflater localLayoutInflater = (LayoutInflater) this.mContext
                  .getSystemService("layout_inflater");
          Viewholder localViewholder = null;
          if (paramView == null) {
              paramView = localLayoutInflater.inflate(R.layout.raw_photo_talent,
                      paramViewGroup, false);
              localViewholder = new Viewholder();
  
              localViewholder.iv_photo = ((ImageView) paramView
                      .findViewById(R.id.iv_photo));
              localViewholder.rl_zoom = ((RelativeLayout) paramView
                      .findViewById(R.id.rl_zoom));
  
              paramView.setTag(localViewholder);
  
          } else {
  
              localViewholder = (Viewholder) paramView.getTag();
          }
  
          imageLoader.displayImage(
                  query + photoArray.get(paramInt).get("thumbnail"),
                  localViewholder.iv_photo, options);
  
          return paramView;
  
      }
  
      static class Viewholder {
  
          ImageView iv_photo;
          RelativeLayout rl_zoom;
  
      }
  
  }
  </code></pre>