private void attemptToSelectComment() { FragmentManager fm = getSupportFragmentManager(); CommentFragment f = (CommentFragment) fm.findFragmentById(R.id.commentDetail); if (f != null && f.isInLayout()) { commentList.shouldSelectAfterLoad = true; } }
@Override public void onCommentSelected(Comment comment) { FragmentManager fm = getSupportFragmentManager(); CommentFragment f = (CommentFragment) fm.findFragmentById(R.id.commentDetail); if (comment != null) { if (f == null || !f.isInLayout()) { WordPress.currentComment = comment; FragmentTransaction ft = fm.beginTransaction(); ft.hide(commentList); f = new CommentFragment(); ft.add(R.id.commentDetailFragmentContainer, f); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.addToBackStack(null); ft.commitAllowingStateLoss(); mMenuDrawer.setDrawerIndicatorEnabled(false); } else { f.loadComment(comment); } } }