title: How to pass data from adapter class to bottom sheet dialog fragment
body: <p>I have a recycler view in my fragment and every recycler view row item has a button so when user clicks on a button it should open <code>BottomSheetDialogFragment</code> and detail info of that particular row item should be visible in BottomSheetDialogFragment.</p>
  <p>What I did so far dialog fragment is showing  properly on the click of a button but I am not getting any idea of how can I pass data to dialog fragment from adapter class.</p>
  <p>Below is my code:</p>
  <p><strong>FactsAdapter.java</strong></p>
  <pre><code>public class FactsAdapter extends RecyclerView.Adapter&lt;FactsAdapter.ViewHolder&gt; {
  
  List&lt;Facts&gt; factList;
  Context context;
  
  public FactsAdapter(List&lt;Facts&gt; factList, Context context) {
      this.factList = factList;
      this.context = context;
  }
  
  @NonNull
  @Override
  public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.facts_row,parent,false);
  
      return new ViewHolder(view);
  }
  
  @Override
  public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
  
      final Facts model = factList.get(position);
  
      final String str1 = model.getDescription();
  
      RequestOptions requestOptions = new RequestOptions();
      requestOptions.placeholder(R.color.place);
  
      holder.title.setText(model.getTitle());
  
      Glide.with(context).load(model.getImage()).apply(requestOptions).into(holder.factImage);
  
      holder.more.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v){ 
             
              BottomSheet bottomSheet = new BottomSheet();
              bottomSheet.show(((FragmentActivity) context).getSupportFragmentManager(),bottomSheet.getTag());
          }
      });
  
  }
  
  @Override
  public int getItemCount() {
      return factList.size();
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
  
      ImageView factImage;
      TextView title;
      Button more;
  
      public ViewHolder(@NonNull View itemView) {
          super(itemView);
  
         factImage = itemView.findViewById(R.id.factImage);
         title = itemView.findViewById(R.id.title);
         more = itemView.findViewById(R.id.more);
        }
      }
  }
  </code></pre>
  <p>Someone please let me know how can I pass data to dialog fragment any help would be appreciated.</p>
  <p><strong>THANKS</strong></p>