private void initFragments() { fragmentManager = new UIFragmentManager(this, R.id.video_detail_content, getSupportFragmentManager()); fragmentManager.put("video_detail_comments", mCommentFragment); fragmentManager.put("video_detail_channel", mEpisodeFragment); fragmentManager.put("video_detail_description", mDetailFragment); }
private void showChildFragment(int id) { if (null == mCurrentMovieDetail) { mNeedShowChildFragmentLater = true; return; } switch (id) { case R.id.video_detail_comment: if (null != mCurrentMovieDetail && null != mCommentFragment && null == mCommentFragment.getArguments()) { // 将MovieId传递给评论Fragment Bundle bundle = new Bundle(); // 这里的调用有可能在mCurrentMovieDetail初始化前, // 因此需要在mCurrentMovieDetail调用完成后再调用它一次 bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_ID, mCurrentMovieDetail.getData().getMovieId()); mCommentFragment.setArguments(bundle); } fragmentManager.show("video_detail_comments"); fragmentId = 0; break; case R.id.video_detail_channel: // 影片选集 if (null != mCurrentMovieDetail && null != mEpisodeFragment && null == mEpisodeFragment.getArguments()) { mEpisodeFragment.setForplayVideoViewActivity(this); // 将MovieId传递给评论Fragment Bundle bundle = new Bundle(); // 这里的调用有可能在mCurrentMovieDetail初始化前, // 因此需要在mCurrentMovieDetail调用完成后再调用它一次 bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_ID, mCurrentMovieDetail.getData().getMovieId()); mEpisodeFragment.setArguments(bundle); } fragmentManager.show("video_detail_channel"); fragmentId = 1; break; case R.id.video_detail_description: if (null != mCurrentMovieDetail && null != mDetailFragment && null == mDetailFragment.getArguments()) { Bundle bundle = new Bundle(); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_AREA, mCurrentMovieDetail.getData().getArea()); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_DETAIL, mCurrentMovieDetail.getData().getDetail()); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_ID, mCurrentMovieDetail.getData().getMovieId()); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_NAME, mCurrentMovieDetail.getData().getMovieName()); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_PATH, mCurrentMovieDetail.getData().getFilmUrl()); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_RELEASE_TIME, mCurrentMovieDetail.getData().getReleaseTime()); bundle.putString( Constants.MovieExtra.EXTRA_MOVIE_TYPE, mCurrentMovieDetail.getData().getType()); bundle.putString(Constants.MovieExtra.EXTRA_MOVIE_THUMB, mMovieThumb); mDetailFragment.setArguments(bundle); } fragmentManager.show("video_detail_description"); fragmentId = 2; break; } }