title: How to Open Detail Fragment on Click of the ViewPager?
body: <p>I, have implemented view-pager in my project. Now I want when I click on particular view-pager It will open a new Detail Fragment. Where according to that Image Slider information is available.</p>
  
  <p>Here is my code:</p>
  
  <p>Adapter Code: </p>
  
  <pre><code>public class SliderImageAdapter extends SliderViewAdapter&lt;SliderImageAdapter.SliderAdapterVH&gt;{
  
      public List&lt;Banner&gt; bannerList;
      public Context context;
  
      public SliderImageAdapter(Context context, List&lt;Banner&gt; bannerList) {
  
          this.bannerList = bannerList;
          this.context = context;
      }
  
      @Override
      public SliderAdapterVH onCreateViewHolder(ViewGroup parent) {
          View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_slider_myshop, parent, false);
          return new SliderAdapterVH(inflate);
      }
  
      @Override
      public void onBindViewHolder(final SliderAdapterVH viewHolder, final int position) {
  
          Glide.with(viewHolder.itemView)
                  .load(bannerList.get(position).getmSliderImage())
                  .fitCenter()
                  .into(viewHolder.imageViewBackground);
      }
  
      @Override
      public int getCount() {
          return bannerList.size();
      }
  
      public int getItemPosition (Object object) {
          return POSITION_NONE;
      }
  
      class SliderAdapterVH extends SliderViewAdapter.ViewHolder {
  
          View itemView;
          ImageView imageViewBackground;
          ImageView imageGifContainer;
  
          public SliderAdapterVH(View itemView) {
              super(itemView);
              imageViewBackground = itemView.findViewById(R.id.iv_auto_image_slider);
              imageGifContainer = itemView.findViewById(R.id.iv_gif_container);
              this.itemView = itemView;
          }
      }
  } 
  </code></pre>
  
  <p>Home Fragment Code: </p>
  
  <pre class="lang-java prettyprint-override"><code>private SliderImageAdapter sliderImageAdapter;
  private List&lt;Banner&gt; bannerList;
  
  sliderMyshop = view.findViewById(R.id.imageSlider);
  sliderMyshop.setSliderAdapter(sliderImageAdapter);
  sliderMyshop.setIndicatorAnimation(IndicatorAnimations.WORM); //set indicator animation by using SliderLayout.IndicatorAnimations. :WORM or THIN_WORM or COLOR or DROP or FILL or NONE or SCALE or SCALE_DOWN or SLIDE and SWAP!!
  sliderMyshop.setSliderTransformAnimation(SliderAnimations.SIMPLETRANSFORMATION);
  sliderMyshop.setIndicatorSelectedColor(Color.WHITE);
  sliderMyshop.setIndicatorUnselectedColor(Color.GRAY);
  sliderMyshop.startAutoCycle();
  
  mFirestore.collection("Banner").orderBy("mSliderImage", Query.Direction.DESCENDING).addSnapshotListener(new EventListener&lt;QuerySnapshot&gt;() {
      @Override
      public void onEvent(@javax.annotation.Nullable QuerySnapshot documentSnapshots, @javax.annotation.Nullable FirebaseFirestoreException e) {
          if (e != null) {
              Log.d(TAG, "Error : " + e.getMessage());
          }
          assert documentSnapshots != null;
  
          for (DocumentChange doc : documentSnapshots.getDocumentChanges()) {
  
              if (doc.getType() == DocumentChange.Type.ADDED) {
                  String doc_id = doc.getDocument().getId();
                  Banner banner = doc.getDocument().toObject(Banner.class).withDocId(doc_id);
                  bannerList.add(doc.getNewIndex(), banner);
                  sliderImageAdapter.notifyDataSetChanged();
  
              } else if (doc.getType() == DocumentChange.Type.MODIFIED) {
                  String docID = doc.getDocument().getId();
                  Banner changedModel = doc.getDocument().toObject(Banner.class).withDocId(docID);
                  if (doc.getOldIndex() == doc.getNewIndex()) {
                      // Item changed but remained in same position
                      bannerList.set(doc.getOldIndex(), changedModel);
                  } else {
                      // Item changed and changed position
                      bannerList.remove(doc.getOldIndex());
                      bannerList.add(doc.getNewIndex(), changedModel);
                  }
              } else if (doc.getType() == DocumentChange.Type.REMOVED) {
                  // remove
                  bannerList.remove(doc.getOldIndex());
              }
              sliderImageAdapter.notifyDataSetChanged();
          }
      }
  });
  </code></pre>
  
  <p>Now I, want to open another fragment on click of a particular image. According to position. Please guide me how to do that. </p>