diff --git a/video/src/main/java/com/ycbjie/video/ui/fragment/VideoArticleFragment.java b/video/src/main/java/com/ycbjie/video/ui/fragment/VideoArticleFragment.java index 70952366a..5bffd1524 100644 --- a/video/src/main/java/com/ycbjie/video/ui/fragment/VideoArticleFragment.java +++ b/video/src/main/java/com/ycbjie/video/ui/fragment/VideoArticleFragment.java @@ -282,7 +282,9 @@ private void showPlayingFragment(String url) { ft.add(android.R.id.content, videoPlayerFragment); } else { ft.show(videoPlayerFragment); + videoPlayerFragment.initData(url); } + ft.commitAllowingStateLoss(); isPlayFragmentShow = true; } diff --git a/video/src/main/java/com/ycbjie/video/ui/fragment/VideoPlayerFragment.java b/video/src/main/java/com/ycbjie/video/ui/fragment/VideoPlayerFragment.java index 42f9be19c..18daf933a 100644 --- a/video/src/main/java/com/ycbjie/video/ui/fragment/VideoPlayerFragment.java +++ b/video/src/main/java/com/ycbjie/video/ui/fragment/VideoPlayerFragment.java @@ -100,11 +100,18 @@ public void initListener() { @Override public void initData() { + initData(url); + } + + /** + * update the url for reshow the fragment + * @param url + */ + public void initData(String url){ VideoModel model = VideoModel.getInstance(); getVideoData(model,url); } - @SuppressLint("CheckResult") private void getVideoData(VideoModel model, String url) { model.getVideoContent(url)