title: Use interface in bottom sheet
body: <p>I want to add a interface in my fragment and my bottom sheet and when bottom sheet done an action(like select a button) it call in my background fragment but when i call interface it returns null and never call when my action done!</p>
  
  <p>this is my code to fill interface , but the condition never called:</p>
  
  <pre><code>if(responseListener != null){
    responseListener.onData( 200,message);
  }
  </code></pre>
  
  <p>my code: </p>
  
  <pre><code>public class FilterBottomSheet extends BottomSheetDialogFragment implements View.OnClickListener {
  
      private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() {
  
          @Override public void onStateChanged(@NonNull View bottomSheet,int newState){
              if(newState==BottomSheetBehavior.STATE_HIDDEN) {
                  dismiss();
              }
          }
      }
  
      @Override public void onSlide(@NonNull View bottomSheet,float slideOffset){}};
  
      @SuppressLint("RestrictedApi")
      @Override
      public void setupDialog(Dialog dialog, int style) {
          super.setupDialog(dialog, style);
          View contentView = View.inflate(getContext(), R.layout.bottom_sheet_filter, null);
          dialog.setContentView(contentView);
  
          CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent())
                  .getLayoutParams();
          CoordinatorLayout.Behavior behavior = params.getBehavior();
  
          if (behavior != null &amp;&amp; behavior instanceof BottomSheetBehavior) {
              ((BottomSheetBehavior) behavior).setBottomSheetCallback(mBottomSheetBehaviorCallback);
          }
      }
  
      @Override
      public void onClick(View view) {
          switch (view.getId()) {
          case R.id.btnDoAction:
              fillActionInterface("TEST");
              dismiss();
              break;
          }
      }
  
      public OnResponseListener responseListener;
  
      private void fillActionInterface(String message) {
  
          if (responseListener != null) {
              responseListener.onData(200, message);
          }
      }
  }
  </code></pre>
  
  <p>So I can't call interface in my another fragment. (because its never calls)</p>