title: How to implement dialog fragment from Recyclerview Adapter?
body: <p>Here cannot resolve the method show. How to fix it. I want to call <code>DialogFragmnent</code> from recycled view. How to resolve this show method from <code>Recyclerview</code> adapter. I want to call this dialog fragment during click on item list of recycled view. How is it possible?     </p>
  
  <pre><code>public class AppointmentServiceListAdapter extends RecyclerView.Adapter&lt;AppointmentServiceListAdapter.ViewHolder&gt;
      {
  
          Context mContext;
          SessionManager mSessionManager;
          ArrayList&lt;AppointServiceList&gt; appointArrayList;
          ArrayList&lt;AppointServiceDetails&gt; appointservicedetailsArrayList;
          AppointmentServiceDetailsAdapter appointmentServiceDetailsAdapter;
  
          public AppointmentServiceListAdapter(Context mContext,ArrayList&lt;AppointServiceList&gt; appointArrayList,ArrayList&lt;AppointServiceDetails&gt; appointservicedetailsArrayList)
          {
              this.mContext = mContext;
              this.appointArrayList = appointArrayList;
              mSessionManager= new SessionManager(mContext);
              this.appointservicedetailsArrayList = appointservicedetailsArrayList;
              appointmentServiceDetailsAdapter = new AppointmentServiceDetailsAdapter(mContext,appointservicedetailsArrayList);
          }
  
          @NonNull
          @Override
          public AppointmentServiceListAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
          {
              LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View view               = inflater.inflate(R.layout.item_my_appointmentlist,parent,false);
              AppointmentServiceListAdapter.ViewHolder viewHolder = new AppointmentServiceListAdapter.ViewHolder(view);
              return viewHolder;
          }
  
          @Override
          public void onBindViewHolder(@NonNull ViewHolder holder, final int position)
          {
                  holder.bookingDate.setText(appointArrayList.get(position).getDate());
                  holder.bookingEmp.setText(appointArrayList.get(position).getEmpName());
                  holder.bookingSlot.setText(appointArrayList.get(position).getSlot());
                  holder.rv_appoint_servicelist.setLayoutManager(new LinearLayoutManager(mContext));
                  holder.rv_appoint_servicelist.setAdapter(appointmentServiceDetailsAdapter);
                  holder.lin_intent.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View v)
                      {
                          FragmentManager mfFragmentManager = ((Activity)mContext).getFragmentManager();
                          AppointmentBookingDialogFragment appointmentBookingDialogFragment = new AppointmentBookingDialogFragment(mContext,position);
                          appointmentBookingDialogFragment.show(mfFragmentManager,"appointmentdialog");
                      }
                  });
  
  
  
                  appointmentServiceDetailsAdapter.notifyDataSetChanged();
  
          }
  
          @Override
          public int getItemCount()
          {
              return appointArrayList.size();
          }
  
          public class ViewHolder extends RecyclerView.ViewHolder
          {
              TextView bookingDate,bookingSlot,bookingEmp;
              RecyclerView rv_appoint_servicelist;
              LinearLayout lin_intent;
  
              public ViewHolder(View itemView)
              {
                  super(itemView);
                  bookingDate            = (TextView)itemView.findViewById(R.id.bookingDate);
                  bookingSlot            = (TextView)itemView.findViewById(R.id.bookingSlot );
                  bookingEmp             = (TextView)itemView.findViewById(R.id.bookingEmp);
                  rv_appoint_servicelist = (RecyclerView)itemView.findViewById(R.id.rv_appoint_servicelist);
                  lin_intent             = (LinearLayout)itemView.findViewById(R.id.lin_intent);
              }
          }
      }
  </code></pre>