code: private void onAttached(View view) {
      decorView.addView(view);
      contentContainer.startAnimation(inAnim);
  
      contentContainer.requestFocus();
      holder.setOnKeyListener(new View.OnKeyListener() {
        @Override public boolean onKey(View v, int keyCode, KeyEvent event) {
          switch (event.getAction()) {
            case KeyEvent.ACTION_UP:
              if (keyCode == KeyEvent.KEYCODE_BACK) {
                if (onBackPressListener != null) {
                  onBackPressListener.onBackPressed(DialogPlus.this);
                }
                if (isCancelable) {
                  onBackPressed(DialogPlus.this);
                }
                return true;
              }
              break;
            default:
              break;
          }
          return false;
        }
      });
    }
docs: It is called when the show() method is called
  
  @param view is the dialog plus view