title: Error in getView method of ImageAdapter
body: <p>I am firing the rawQuery for selectin the gender.If gender is male then male photo should get deployed on dashboard.But i am getting error "NullPointerEcxeption" in rawQuery statement.
  Could you please help me out there? Thanks.</p>
  
  <p>My getView function in ImageAdapter is</p>
  
  <pre><code> public View getView(int position, View convertView, ViewGroup parent) 
  {
      ImageView imageView = new ImageView(mContext);;
      HashMap&lt;String, Integer&gt; images = new HashMap&lt;String, Integer&gt;();    
      images.put( "male", Integer.valueOf( R.drawable.kidmale));
      images.put( "female", Integer.valueOf( R.drawable.kidfemale));    
      //String select="SELECT gender FROM db_mydata.tbl_mykid";
      Cursor res=db.rawQuery("SELECT gender FROM tbl_mykid " ,new String[]{gender}); 
      while(res.moveToNext())
      {
          String s=res.getColumnName(3);
          if(s=="male")
          {
              imageView.setImageResource( images.get( "male").intValue() );
          }
          else  
          {
              imageView.setImageResource( images.get( "female" ).intValue() ); 
          }
      }
      if (convertView == null) 
      {  // if it's not recycled, initialize some attributes
          imageView = new ImageView(mContext);
          imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
          imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
          imageView.setPadding(8, 8, 8, 8);
      } 
      else 
      {
          imageView = (ImageView) convertView;
      }
      imageView.setImageResource(mThumbIds[position]);
      return imageView;
  }   
  // references to our images
  private Integer[] mThumbIds = {R.drawable.add,};
  </code></pre>