Exemplo n.º 1
0
  public void showReplyDialog(Comment comment) {
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    Fragment prev = getFragmentManager().findFragmentByTag(REPLY_DIALOG_FRAGMENT);
    if (prev != null) {
      ft.remove(prev);
    }
    ft.addToBackStack(null);

    ReplyDialog replyDialog = new ReplyDialog();

    Bundle args = new Bundle();
    args.putString(ReplyDialog.ARG_UNIQUE_ID, comment.getUniqueId());
    args.putString(
        ReplyDialog.ARG_REPLY, comment.getReply() == null ? "" : comment.getReply().getText());

    replyDialog.setArguments(args);

    replyDialog.show(ft, REPLY_DIALOG_FRAGMENT);
  }