title: OnItemClickEvent not fired in GridView in android
body: <p>i m developing an application in which gridview contain list of button...</p>
  
  <p>when i place images instead of button in gridview then onItemClickEvent get fired..but if i place button in gridView then click event not getting callled...i dont know what is the problem...even i m not getting exception..</p>
  
  <p>here is my code...</p>
  
  <pre><code>public class MainMenu extends Activity
  {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
  
  
      GridView gridview = (GridView) findViewById(R.id.mainMenu);
      gridview.setAdapter(new ImageAdapter(this));
  
      gridview.setOnItemClickListener(new OnItemClickListener()
      {
          public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)
          {
              Toast.makeText(MainMenu.this, "hello" + position, Toast.LENGTH_SHORT).show();
          }
      });
  
  
  
  }
  //inner class for adapter
  
  class ImageAdapter extends BaseAdapter {
      private Context mContext;
  
      public ImageAdapter(Context c)
      {
          mContext = c;
      }
  
      public int getCount() {
          return mThumbIds.length;
      }
  
      public Object getItem(int position) {
          return null;
      }
  
      public long getItemId(int position) {
          return 0;
      }
  
      // create a new ImageView for each item referenced by the Adapter
      public View getView(int position, View convertView, ViewGroup parent) {
          //ImageView imageView;
          Button btn;
  
          if (convertView == null) {  // if it's not recycled, initialize some attributes
  
              btn=new Button(mContext);
         //   imageView = new ImageView(mContext);
  
              btn.setLayoutParams(new GridView.LayoutParams(120,120));
          //  imageView.setLayoutParams(new GridView.LayoutParams(140,140));
  
  
              //imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
              btn.setPadding(10,15, 10,15);
              btn.setImeActionLabel("hello",0);// actionId)
  
          //  imageView.setPadding(8,8, 8, 8);
  
          } else 
          {
              btn=(Button)convertView;
              //imageView=(ImageView)convertView;
          }
          btn.setBackgroundResource(mThumbIds[position]);
          //imageView.setImageResource(mThumbIds[position]);
          //return imageView;
          return btn;
      }
  
      // references to our images
      private Integer[] mThumbIds = 
      {
              R.drawable.pantrylocator_icon,
              R.drawable.volunteeropportunity_icon,
              R.drawable.volunteerlocator_icon,
              R.drawable.volunteermanagement_icon,
              R.drawable.donationform_icon,
              R.drawable.donationviamsg_icon,
              R.drawable.donationvideo_icon,
              R.drawable.virtualfooddrive_icon,
              R.drawable.newevent_icon,
              R.drawable.pressrelease_icon,
              R.drawable.volunteerphotos_icon,
              R.drawable.aboutus_icon,
  
       };
  }
  }
  </code></pre>