title: StickyGridHeader example
body: <p>I'm implementing a grid view which have headers(months) and images for each month. I'm trying to implement base adapter but it doesn't seems to work.</p>
  
  <pre><code>GridView stickyGrid = (GridView) findViewById(R.id.show_gridview);
          GridViewAdapter adapter = new GridViewAdapter(getBaseContext());
          stickyGrid.setAdapter(adapter);
  </code></pre>
  
  <p>Base Adapter implementation</p>
  
  <pre><code>public class GridViewAdapter extends BaseAdapter implements
          StickyGridHeadersBaseAdapter {
  
      private LayoutInflater inflater;
  
      public GridViewAdapter(Context context) {
          inflater = LayoutInflater.from(context);
      }
  
      @Override
      public int getCount() {
          imageUrls.size();
          return 0;
      }
  
      @Override
      public Object getItem(int position) {
          return imageUrls.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          ImageView holder;
  
          if (convertView == null) {
              holder = (ImageView) inflater.inflate(R.layout.item_grid,
                      parent, false);
          } else {
              holder = (ImageView) convertView;
          }
  
          imageLoader.displayImage(Util.BASE_URL + imageUrls.get(position),
                  holder, options, new SimpleImageLoadingListener() {
                      @Override
                      public void onLoadingStarted(String imageUri, View view) {
                          spinner.setVisibility(View.VISIBLE);
                      }
  
                      @Override
                      public void onLoadingFailed(String imageUri, View view,
                              FailReason failReason) {
                          String message = null;
                          switch (failReason.getType()) {
                          case IO_ERROR:
                              message = "Input/Output error";
                              break;
                          case DECODING_ERROR:
                              message = "Image can't be decoded";
                              break;
                          case NETWORK_DENIED:
                              message = "Downloads are denied";
                              break;
                          case OUT_OF_MEMORY:
                              message = "Out Of Memory error";
                              break;
                          case UNKNOWN:
                              message = "Unknown error";
                              break;
                          }
                          Toast.makeText(getBaseContext(), message,
                                  Toast.LENGTH_SHORT).show();
                          spinner.setVisibility(View.GONE);
                      }
  
                      @Override
                      public void onLoadingComplete(String imageUri,
                              View view, Bitmap loadedImage) {
                          spinner.setVisibility(View.GONE);
                      }
                  });
          return holder;
      }
  
      @Override
      public int getCountForHeader(int arg0) {
          return datesHeader.size();
  
      }
  
      @Override
      public View getHeaderView(int position, View convertView,
              ViewGroup parent) {
          TextView holder;
          if (convertView == null) {
              holder = (TextView) inflater.inflate(R.layout.date_header,
                      parent, false);
          } else {
              holder = (TextView) convertView;
          }
          holder.setText(datesHeader.get(position));
          return holder;
      }
  
      @Override
      public int getNumHeaders() {
          // TODO Auto-generated method stub
          return 0;
      }
  
  }
  </code></pre>
  
  <p>First of all, the issue I'm having is that it doesn't execute getView for any of them (simple and header). The next thing in my mind is that how can I set headers for particular images. I have a array list ofimage url's and another for headers (months). Please help me because I've already spent 4 days on it and couldn't find any solution.</p>