title: Android Custom ImageView onclick listener not working
body: <p>In my app Viewpager,am using Custom ImageView called ZoomImageView, and it not triggers during OnClick listener,When i used normal imageview it triggers ,I have no idea how to do that in ZoomImageView,,Some help is really appreciated...</p>
  
  <p><strong>My ViewPager :</strong></p>
  
  <pre><code>class ImageGalleryViewPagerAdapter extends FragmentStatePagerAdapter {
      List&lt;Gallery&gt; url;
      @SuppressWarnings("deprecation")
      android.widget.Gallery gallery;
  
      @SuppressWarnings("deprecation")
      public ImageGalleryViewPagerAdapter(FragmentManager fm,
              List&lt;Gallery&gt; currentUrl, android.widget.Gallery galleryView) {
          super(fm);
          this.url = currentUrl;
          this.gallery = galleryView;
      }
  
      @Override
      public int getCount() {
          return url.size();
      }
  
      @Override
      public Fragment getItem(int index) {
          gallery.setSelection(index);
          ImageGalleryZoomImageFragment fragment = new ImageGalleryZoomImageFragment();
          Bundle bundle = new Bundle();
          bundle.putString(ListViewConstants.GALLERY_IMAGE_URL, url.get(index)
                  .getImageUrl());
          fragment.setArguments(bundle);
          return fragment;
      }
  
  }
  </code></pre>
  
  <p><strong>My Fragment :</strong></p>
  
  <pre><code>public class ImageGalleryZoomImageFragment extends BaseFragment {
      public ZoomImageView imageView;
      private String url;
      private ImageLoader imageLoader;
  
      @Override
      protected void initViews() {
          url = getArguments().getString(ListViewConstants.GALLERY_IMAGE_URL);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.new_gallery_fullview, null);
          initViews();
          TrackerDetails.tracKPage(getActivity());
          imageView = (ZoomImageView) view.findViewById(R.id.selected_imageview);
          imageLoader = new ImageLoader(getActivity());
          return view;
      }
  
      @Override
      public void onViewCreated(View view, Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
          imageLoader.setRequiredSize(200);
          imageLoader.displayImage(url, imageView);
          imageView.setOnClickListener(new YourOnClickListener());
  
      }
  
      class YourOnClickListener implements View.OnClickListener {
  
      @Override
      public void onClick(View v) {
          if (getActivity().findViewById(R.id.jumeirah_gallery) != null) {
              if (getActivity().findViewById(R.id.jumeirah_gallery)
                      .getVisibility() == View.VISIBLE) {
                  getActivity().findViewById(R.id.jumeirah_gallery)
                          .setVisibility(View.GONE);
              } else {
                  getActivity().findViewById(R.id.jumeirah_gallery)
                          .setVisibility(View.VISIBLE);
              }
          }
      }
  
  }
  }
  </code></pre>
  
  <p><strong>fragment.xml</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/zoom_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;com.commonui.components.ZoomImageView
          android:id="@+id/selected_imageview"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>