title: OnClickListener on CustomDialog from Fragment
body: <p>I've a customDialog class and I call it in a different fragment.
  I want to create the <code>onClick</code> function in this fragment, but my click don't do anything.
  The custom dialog code :</p>
  <pre><code>public enum SwipeType {LIKE, NOPE}
  private SwipeType swipeType;
  private Record swipeRecord;
  
  public NewsfeedDialogBox(Context paramContext, SwipeType type, Record record) {
      super(paramContext);
      this.mContext = paramContext;
      this.swipeType = type;
      this.swipeRecord = record;
  }
  
  protected void onCreate(Bundle paramBundle) {
      super.onCreate(paramBundle);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.newsfeed_dialog_layout);
      preferences = PreferenceDatabase.getInstance(mContext);
      setCanceledOnTouchOutside(false);
      ButterKnife.bind(this);
      setupBox();
  }
  
  private void setupBox() {
      swipeYesButton.setOnClickListener(this);
      swipeNoButton.setOnClickListener(this);
      if (swipeType == SwipeType.LIKE) {
          swipeBoxTitle.setText(R.string.swipe_love_title);
          swipeBoxLogo.setImageResource(R.drawable.like_icon);
      } else {
          swipeBoxTitle.setText(R.string.swipe_nope_title);
          swipeBoxLogo.setImageResource(R.drawable.cross_close);
      }
      String url = &quot;&quot;;
      int loader = 0;
      if (swipeRecord instanceof Track) {
          url = &quot;http:&quot; + ((Track) swipeRecord).getAlbum().getThumbnailUrl();
          loader = R.drawable.music_load;
      } else if (swipeRecord instanceof Album) {
          url = &quot;http:&quot; + ((Album) swipeRecord).getThumbnailUrl();
          loader = R.drawable.music_load;
      } else if (swipeRecord instanceof Playlist) {
          url = &quot;http:&quot; + ((Playlist) swipeRecord).getThumbnailUrl();
          loader = R.drawable.music_load;
      } else if (swipeRecord instanceof Image) {
          url = &quot;http:&quot; + ((Image) swipeRecord).getBestImageUrl();
          loader = R.drawable.image_load;
      } else if (swipeRecord instanceof Video) {
          url = &quot;http:&quot; + ((Video) swipeRecord).getThumbnailUrl();
          loader = R.drawable.video_load;
      } else if (swipeRecord instanceof Movie) {
          url = &quot;http:&quot; + ((Movie) swipeRecord).getThumbnailUrl();
          loader = R.drawable.movie_load;
      }
      Picasso.with(mContext)
              .load(url)
              .config(Utils.getBitmapConfig(mContext))
              .error(loader)
              .placeholder(loader)
              .fit()
              .centerCrop()
              .into(swipeBoxBackground);
  }
  </code></pre>
  <p>My fragment code :</p>
  <pre><code>public void firstLike(Record record) {
      if (!PreferenceDatabase.getInstance(getContext()).isSwipeLikeDone()) {
          newsfeedDialogBox = new NewsfeedDialogBox(getContext(), NewsfeedDialogBox.SwipeType.LIKE,record);
          newsfeedDialogBox.show();
          Button yesButton = (Button)newsfeedDialogBox.findViewById(R.id.swipe_yes_button);
          yesButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  newsfeedDialogBox.dismiss();
              }
          });
      }
  }
  </code></pre>
  <p>this is my CustomDialog
  <a href="https://i.stack.imgur.com/ORCaP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ORCaP.jpg" alt="Custom Dialog" /></a></p>