From cbb88109494ffc7916f6639c20ce05c0cec941a9 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 07 四月 2021 15:07:45 +0800
Subject: [PATCH] 3.9.1bug修复

---
 BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java                   |   10 ++
 BuWanVideo/build.gradle                                                        |    4 
 BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java        |    3 
 BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java |   13 ++
 BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java              |   10 ++
 BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java       |   24 ++++--
 library-common/src/com/lcjian/library/RetainViewFragment.java                  |    4 
 BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java                    |   13 +++
 BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java   |    6 +
 BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java              |    2 
 BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java       |   16 ++-
 BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java           |    8 +
 BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java                      |    3 
 BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java              |   12 ++
 BuWanVideo/AndroidManifest.xml                                                 |   25 ++----
 BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java         |    5 +
 BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java     |    5 +
 BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java        |    6 +
 BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java            |   15 ++-
 BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java                |    2 
 20 files changed, 129 insertions(+), 57 deletions(-)

diff --git a/BuWanVideo/AndroidManifest.xml b/BuWanVideo/AndroidManifest.xml
index d10f071..d9fd4c9 100644
--- a/BuWanVideo/AndroidManifest.xml
+++ b/BuWanVideo/AndroidManifest.xml
@@ -63,6 +63,7 @@
 
         <activity
             android:name="com.weikou.beibeivideo.ui.SplashActivity"
+            android:exported="true"
             android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -72,6 +73,7 @@
         </activity>
         <activity
             android:name="com.weikou.beibeivideo.ui.main.MainActivity"
+            android:exported="true"
             android:label="@string/app_name"
             android:launchMode="singleTask"
             android:theme="@style/AppTabTheme3"></activity>
@@ -301,20 +303,16 @@
 
         <provider
             android:name="com.weikou.beibeivideo.db.WatchHistoryProvider"
-            android:authorities="com.yeshi.ddysvideo.provider.watchhistory"
-            android:exported="false" />
+            android:authorities="com.yeshi.ddysvideo.provider.watchhistory" />
         <provider
             android:name="com.weikou.beibeivideo.db.DownloadProvider"
-            android:authorities="com.yeshi.ddysvideo.provider.download"
-            android:exported="false" />
+            android:authorities="com.yeshi.ddysvideo.provider.download" />
         <provider
             android:name="com.weikou.beibeivideo.db.MessageProvider"
-            android:authorities="com.yeshi.ddysvideo.provider.message"
-            android:exported="false" />
+            android:authorities="com.yeshi.ddysvideo.provider.message" />
         <provider
             android:name="com.mozillaonline.providers.downloads.DownloadProvider"
-            android:authorities="com.ddysvideo.downloads"
-            android:exported="false" />
+            android:authorities="com.ddysvideo.downloads" />
 
         <!--鐧惧害鍐呭鑱旂洘 -->
         <provider
@@ -463,8 +461,7 @@
         <!-- 缃戠洘骞垮憡 -->
         <provider
             android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
-            android:authorities="com.doudou.ysvideo.TTMultiProvider"
-            android:exported="false" />
+            android:authorities="com.doudou.ysvideo.TTMultiProvider" />
 
         <!--鏂版氮 -->
         <activity
@@ -544,9 +541,7 @@
             android:name="push_kit_auto_init_enabled"
             android:value="true" />
         <!-- 鍗庝负鎺ㄩ�佹湇鍔℃敞鍐� -->
-        <service
-            android:name=".service.HWPushService"
-            android:exported="false">
+        <service android:name=".service.HWPushService">
             <intent-filter>
                 <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
             </intent-filter>
@@ -584,9 +579,7 @@
 
 
         <!-- VIVO鎺ㄩ�� -->
-        <receiver
-            android:name=".receiver.VIVOPushMessageReceiver"
-            android:exported="false">
+        <receiver android:name=".receiver.VIVOPushMessageReceiver">
             <intent-filter>
                 <!--鎺ユ敹push娑堟伅-->
                 <action android:name="com.vivo.pushclient.action.RECEIVE" />
diff --git a/BuWanVideo/build.gradle b/BuWanVideo/build.gradle
index 8d6cf53..c1bd427 100644
--- a/BuWanVideo/build.gradle
+++ b/BuWanVideo/build.gradle
@@ -94,8 +94,8 @@
 
     defaultConfig {
         applicationId "com.doudou.ysvideo"
-        versionCode 109
-        versionName "3.9.0"
+        versionCode 110
+        versionName "3.9.1"
         multiDexEnabled = true
         minSdkVersion 17
         targetSdkVersion 27
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java
index cf52463..2e9e47f 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java
@@ -1173,12 +1173,13 @@
      * @param handler
      */
     public static void getVideoEpisodeList(Context context, String uid,
-                                           String ResourceId, String videoId, int page,
+                                           String ResourceId, String videoId, int page,int pageSize,
                                            ResponseHandlerInterface handler) {
         LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
         params.put("Method", "getVideoEpisodeList");
         params.put("Uid", uid);
         params.put("Page", page + "");
+        params.put("PageSize", pageSize + "");
         params.put("VideoId", videoId);
         params.put("ResourceId", ResourceId);
         commonPost(context, BASE_URL + "recommend", params, handler);
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java
index d44c889..6590024 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java
@@ -309,7 +309,7 @@
                     // 娴嬭瘯
                     if (System.currentTimeMillis() - SplashADFragment.lastShowTime < 1000 * 60 * 30L)
                         return;
-                    
+
                     if (SplashADFragment.isAdLoaded()) {
                         startActivity(new Intent(getApplicationContext(), SplashAdActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
                         return;
@@ -345,7 +345,13 @@
                         @Override
                         public void onAdLoad(SplashAdLoadInfo adLoadInfo) {
                             //灞曠ず骞垮憡
-                            startActivity(new Intent(getApplicationContext(), SplashAdActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
+                            try {
+                                startActivity(new Intent(getApplicationContext(), SplashAdActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
+                            } catch (SecurityException e) {
+
+                            } catch (Exception e) {
+
+                            }
                         }
 
                         @Override
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java b/BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java
index 93d1d05..d0141a8 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/entity/VideoInfo.java
@@ -92,6 +92,19 @@
     @Expose
     private VideoAlbumMoreInfo albumMoreInfo;
 
+    //椤靛ぇ灏�
+    @Expose
+    private int pageSize;
+
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
     public VideoAlbumMoreInfo getAlbumMoreInfo() {
         return albumMoreInfo;
     }
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java
index 415fbb4..bccf7e0 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java
@@ -114,6 +114,7 @@
         //鍒濆鍖栦竴娆anner锛屽惁鍒欏悗闈anner浣跨敤鏃朵細鍑虹幇鍗¢】
 //        new BannerView(SplashActivity.this, ADSize.BANNER, BeibeiConstant.GDT_ID, BeibeiConstant.GDT_PLAYER_DETAIL);
         //寮圭敤鎴峰崗璁
+
         showProtocol();
 
 
@@ -139,7 +140,7 @@
                 "4銆佹湭缁忕洃鎶や汉鍚屾剰锛屾垜浠笉浼氭敹闆嗕娇鐢�14鍛ㄥ瞾浠ヤ笅锛堝惈14鍛ㄥ瞾锛夋湭鎴愬勾浜轰釜浜轰俊鎭紝涓斾笉浼氬埄鐢ㄥ叾淇℃伅鎺ㄩ�佹柊闂汇�佹椂鏀夸俊鎭�佸箍鍛婄瓑瀹氬悜鎺ㄩ�佹椿鍔ㄣ��";
 
         if (!UserUtil.isAgreeUserProtocol(BeibeiVideoApplication.application) && !BeibeiConstant.IS_TEST) {
-            new UserProtocolDialog.Builder(this).setNegativeButton("涓嶅悓鎰�", new DialogInterface.OnClickListener() {
+            Dialog dialog = new UserProtocolDialog.Builder(this).setNegativeButton("涓嶅悓鎰�", new DialogInterface.OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int which) {
                     SplashActivity.this.finish();
@@ -157,7 +158,12 @@
                         }
                     });
                 }
-            }).setData(data).create().show();
+            }).setData(data).create();
+
+            if (!isFinishing()) {
+                dialog.show();
+            }
+
         } else {
             //璇锋眰鏉冮檺
             vg_ad.post(new Runnable() {
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java
index f8a19fe..44dda94 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashADFragment.java
@@ -46,7 +46,7 @@
         this.mAdShowListener = mAdShowListener;
     }
 
-    private SplashADFragment() {
+    public SplashADFragment() {
 
     }
 
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java
index d87ae46..a440ad6 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/ad/SplashAdActivity.java
@@ -1,6 +1,7 @@
 package com.weikou.beibeivideo.ui.ad;
 
 import android.os.Bundle;
+import android.view.KeyEvent;
 
 import com.weikou.beibeivideo.R;
 import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo;
@@ -33,9 +34,7 @@
                 finish();
             }
         });
-
         getSupportFragmentManager().beginTransaction().replace(R.id.fl_splash_ad, splashADFragment).commitAllowingStateLoss();
-
     }
 
 
@@ -45,6 +44,15 @@
         EventBus.getDefault().unregister(this);
     }
 
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK)
+            return false;
+        else
+            return super.onKeyDown(keyCode, event);
+    }
+
     public void onEventMainThread(SplashAdLoadInfo adLoadInfo) {
         finish();
     }
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
index ea05ed9..9fa5a34 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
@@ -223,7 +223,7 @@
                     VideoInfo videoInfo = new VideoInfo();
                     videoInfo.setId("8065880");
                     videoInfo.setThirdType("0");
-                    Intent intent = new Intent(MainActivity.this, VideoDetailActivity2.class);
+                    Intent intent = new Intent(MainActivity.this, SearchActivity.class);
                     intent.putExtra("video_info", videoInfo);
                     startActivity(intent);
                 }
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java
index 04fba8d..9d04a49 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodeFragment.java
@@ -111,6 +111,9 @@
 
     private int episodePage = 2;//褰撳墠椤�
 
+    //榛樿椤靛ぇ灏忎负100
+    private int pageSize = 100;
+
     private String fromName = null;
 
     public static DisplayImageOptions option = new DisplayImageOptions.Builder()
@@ -127,13 +130,14 @@
             .build();
 
     public static EpisodeFragment newInstance(VideoInfo videoInfo,
-                                              int playingPosition, int start, int end, String from) {
+                                              int playingPosition, int pageSize, int start, int end, String from) {
         EpisodeFragment episodeFragment = new EpisodeFragment();
         Bundle args = new Bundle();
         args.putSerializable("video_info", videoInfo);
         args.putInt("playing_position", playingPosition);
         args.putInt("start", start);
         args.putInt("end", end);
+        args.putInt("pageSize", pageSize);
         args.putString("from", from);
         episodeFragment.setArguments(args);
         return episodeFragment;
@@ -240,6 +244,7 @@
                 .getString("from", "");
 
         mPlayingPosition = bundle.getInt("playing_position");
+        pageSize = bundle.getInt("pageSize", 100);
         mStart = bundle.getInt("start");
         mEnd = bundle.getInt("end");
 
@@ -338,7 +343,7 @@
                             break;
                         }
                         if (checkedResource != null) {
-                            loadMoreEpisode(mVideoInfo.getId(), checkedResource.getId(), episodePage);
+                            loadMoreEpisode(mVideoInfo.getId(), checkedResource.getId(), episodePage, pageSize);
                         }
                     }
                 }
@@ -790,7 +795,7 @@
             ImageView iv = view.findViewById(R.id.iv_resource);
             TextView tv = view.findViewById(R.id.tv_resource);
             try {
-                Glide.with(getActivity().getApplicationContext())
+                Glide.with(iv)
                         .load(reList.get(position).getPicture())
                         .apply(new RequestOptions().placeholder(R.drawable.from_other).error(R.drawable.from_other))
                         .into(iv);
@@ -1014,8 +1019,8 @@
      * @param videoId
      * @param resourceId
      */
-    private synchronized void loadMoreEpisode(String videoId, String resourceId, int page) {
-        BeibeiVideoAPI.getVideoEpisodeList(ll_add_attention.getContext(), UserUtil.getUid(getContext()), resourceId, videoId, page, new
+    private synchronized void loadMoreEpisode(String videoId, String resourceId, int page, int pageSize) {
+        BeibeiVideoAPI.getVideoEpisodeList(ll_add_attention.getContext(), UserUtil.getUid(getContext()), resourceId, videoId, page, pageSize, new
 
                 BasicTextHttpResponseHandler() {
                     @Override
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java
index 3ebcc05..74403c5 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/EpisodePagerAdapter.java
@@ -14,13 +14,15 @@
     private int mPlayingPosition;
 
     private String fromName;
+    private int pageSize;
 
     public EpisodePagerAdapter(FragmentManager fm, VideoInfo videoInfo,
-                               int playingPosition, String from) {
+                               int playingPosition, int pageSize, String from) {
         super(fm);
         this.mVideoInfo = videoInfo;
         this.mPlayingPosition = playingPosition;
         this.fromName = from;
+        this.pageSize = pageSize;
     }
 
     @Override
@@ -30,7 +32,7 @@
         if (end > VideoUtil.videoEpisodeList.size()) {
             end = VideoUtil.videoEpisodeList.size();
         }
-        return EpisodeFragment.newInstance(mVideoInfo, getPlayingPosition(), start,
+        return EpisodeFragment.newInstance(mVideoInfo, getPlayingPosition(), pageSize, start,
                 end, fromName);
     }
 
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java
index 8e26c26..184ab21 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailActivity2.java
@@ -895,6 +895,8 @@
                                 Log.i("mResult", "鏄惁鏄粠瑙傜湅璁板綍鐐瑰嚮杩涙潵鐨�:" + isFromWatchHistory);
                                 if (isFromWatchHistory || position > 0) {
                                     mPosition = getIntent().getIntExtra("playing_position", 0);
+                                    //闃叉鏁扮粍瓒婄晫
+                                    mPosition = mPosition >= VideoUtil.videoEpisodeList.size() ? VideoUtil.videoEpisodeList.size() - 1 : mPosition;
                                     EventBus.getDefault().post(videoInfo);
                                     getUrl(VideoUtil.videoEpisodeList.get(mPosition), isSetup);
                                     EventBus.getDefault().post(VideoUtil.videoEpisodeList.get(mPosition));
@@ -937,11 +939,16 @@
 
                                             @Override
                                             public void run() {
-                                                EventBus.getDefault().post(
-                                                        videoInfo);
-                                                EventBus.getDefault()
-                                                        .post(VideoUtil.videoEpisodeList
-                                                                .get(0));
+
+                                                try {
+                                                    EventBus.getDefault().post(
+                                                            videoInfo);
+                                                    EventBus.getDefault()
+                                                            .post(VideoUtil.videoEpisodeList
+                                                                    .get(0));
+                                                } catch (NullPointerException e) {
+                                                    //鍑虹幇杩囩┖鎸囬拡鐨勫紓甯�
+                                                }
                                             }
                                         }, 200);
                             }
@@ -1067,10 +1074,11 @@
                 @Override
                 public void run() {
                     EventBus.getDefault().post(videoInfo);
+                    int position = getIntent().getIntExtra("playing_position", 0) >=
+                            VideoUtil.videoEpisodeList.size() ? VideoUtil.videoEpisodeList.size() - 1 : getIntent().getIntExtra("playing_position",
+                            0);
                     EventBus.getDefault().post(
-                            VideoUtil.videoEpisodeList.get(
-                                    getIntent().getIntExtra("playing_position",
-                                            0)));
+                            VideoUtil.videoEpisodeList.get(position));
                 }
             }, 200);
         }
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java
index d633f99..bc7f370 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoDetailFragment.java
@@ -65,7 +65,7 @@
         if (getArguments() != null)
             mPlayingPosition = getArguments().getInt("playing_position", 0);
 
-        if(getArguments()!=null)
+        if (getArguments() != null)
             getArguments().clear();
         return view;
     }
@@ -118,6 +118,7 @@
         Bundle bundle = new Bundle();
         bundle.putSerializable("video_info", mVideoInfo);
         bundle.putInt("playing_position", mPlayingPosition);
+        bundle.putInt("pageSize", mVideoInfo.getPageSize());
         videoEpisodeFragment.setArguments(bundle);
         getChildFragmentManager().beginTransaction().add(R.id.fl_add_container, videoEpisodeFragment, "VideoEpisodeFragment").commitAllowingStateLoss();
 
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java
index 1b84770..ed9b304 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/media/VideoEpisodeFragment.java
@@ -81,11 +81,12 @@
     private String from;
 
     public static VideoEpisodeFragment newInstance(VideoInfo videoInfo,
-                                                   int playingPostion, String from) {
+                                                   int playingPostion, int pageSize, String from) {
         VideoEpisodeFragment videoEpisodeFragment = new VideoEpisodeFragment();
         Bundle args = new Bundle();
         args.putSerializable("video_info", videoInfo);
         args.putInt("playing_position", playingPostion);
+        args.putInt("pageSize", pageSize);
         args.putString("from", from);
         videoEpisodeFragment.setArguments(args);
         return videoEpisodeFragment;
@@ -140,12 +141,16 @@
         return R.layout.video_episode_fragment;
     }
 
+    private int pageSize = 100;
+
     @Override
     public void onCreateView(View contentView, Bundle savedInstanceState) {
         Log.d(TAG, "onCreateView");
         sv_detail = contentView.findViewById(R.id.sv_detail);
         mVideoInfo = (VideoInfo) getArguments().getSerializable("video_info");
         mPlayingPosition = getArguments().getInt("playing_position");
+        pageSize = getArguments().getInt("pageSize", 100);
+
         if (getArguments() != null)
             getArguments().clear();
         // ******绠�浠�*******
@@ -191,7 +196,7 @@
             return;
 
         mEpisodePagerAdapter = new EpisodePagerAdapter(
-                getChildFragmentManager(), mVideoInfo, mPlayingPosition, from);
+                getChildFragmentManager(), mVideoInfo, mPlayingPosition, pageSize, from);
         //
         vp_episode.setAdapter(mEpisodePagerAdapter);
         // 鎸囩ず褰撳墠鎾斁椤�---hxh
@@ -274,7 +279,7 @@
                                 ll_relative_video.setVisibility(View.GONE);
                             } else {
                                 ll_relative_video.setVisibility(View.VISIBLE);
-                                final VideoColumn2Adapter adapter = new VideoColumn2Adapter(getActivity(), getContext(), videoInfos, false, 2,"relative", new IVideoClickListener() {
+                                final VideoColumn2Adapter adapter = new VideoColumn2Adapter(getActivity(), getContext(), videoInfos, false, 2, "relative", new IVideoClickListener() {
                                     @Override
                                     public void onClick(VideoInfo video) {
                                         ChangeVideoEvent changeVideoEvent = new ChangeVideoEvent();
@@ -331,7 +336,7 @@
                                             .getJSONArray("data").toString(),
                                     new TypeToken<List<VideoInfo>>() {
                                     }.getType());
-                            final VideoColumn2Adapter adapter = new VideoColumn2Adapter(getActivity(), getContext(), videoInfos, false, 2,"guessLike", new IVideoClickListener() {
+                            final VideoColumn2Adapter adapter = new VideoColumn2Adapter(getActivity(), getContext(), videoInfos, false, 2, "guessLike", new IVideoClickListener() {
                                 @Override
                                 public void onClick(VideoInfo video) {
                                     ChangeVideoEvent changeVideoEvent = new ChangeVideoEvent();
@@ -381,8 +386,9 @@
         if (mPlayingPosition != playingPosition) {
             mPlayingPosition = playingPosition;
         }
+        pageSize = info.getPageSize();
         mEpisodePagerAdapter = new EpisodePagerAdapter(
-                getChildFragmentManager(), info, mPlayingPosition, from);
+                getChildFragmentManager(), info, mPlayingPosition, pageSize, from);
         //
         vp_episode.setAdapter(mEpisodePagerAdapter);
     }
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java
index 08ae88b..2901d35 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchActivity.java
@@ -239,7 +239,10 @@
     public void onClick(final View v) {
         switch (v.getId()) {
             case R.id.tv_search_cancel:
-                finish();
+                if (fl_suggest.getVisibility() == View.VISIBLE) {
+                    hiddenSuggestFragment();
+                } else
+                    finish();
                 break;
             case R.id.tv_search_clear_his:
                 clearHistorySearch();
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java
index 44b9432..adc22ff 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/recommend/SearchResultActivity.java
@@ -473,6 +473,12 @@
                 new BasicTextHttpResponseHandler() {
 
                     @Override
+                    public void onStart() {
+                        super.onStart();
+                        hiddenSuggestFragment();
+                    }
+
+                    @Override
                     public void onSuccessPerfect(int statusCode,
                                                  Header[] headers, JSONObject jsonObject)
                             throws Exception {
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java
index ba91b6e..c7e2599 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/FunshionPlayerFragment.java
@@ -589,6 +589,8 @@
 
     //骞垮憡灞曠ず瀹屾垚
     private void adShowFinish(FunshionPlayInfo info) {
+        if (fl_ad == null)
+            return;
         fl_ad.setVisibility(View.GONE);
         fl_ad.removeAllViews();
         //鎾斁瑙嗛
@@ -1007,7 +1009,8 @@
                     vpc_funshion.post(new Runnable() {
                         @Override
                         public void run() {
-                            tv_skip.setVisibility(View.GONE);
+                            if (tv_skip != null)
+                                tv_skip.setVisibility(View.GONE);
                             adShowFinish(info);
                         }
                     });
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java
index a3829df..e17408b 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java
@@ -4,6 +4,7 @@
 import android.app.Notification;
 import android.app.NotificationChannel;
 import android.app.NotificationManager;
+import android.content.ActivityNotFoundException;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.content.res.Configuration;
@@ -116,9 +117,15 @@
             public void onClick(View v) {
                 hiddenMenu();
                 String url = tv_url.getText().toString();
-                Uri uri = Uri.parse(url);
-                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
-                startActivity(intent);
+                try {
+                    Uri uri = Uri.parse(url);
+                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                    startActivity(intent);
+                } catch (ActivityNotFoundException e) {
+                    Toast.makeText(VideoPlayerBrowserActivity.this, "鏃犳硶鎵惧埌娴忚鍣�", Toast.LENGTH_SHORT).show();
+                } catch (Exception e) {
+
+                }
             }
         });
 
diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java b/BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java
index 246930a..4fd5687 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/util/ad/TTAdManagerHolder.java
@@ -29,8 +29,12 @@
     //step1:鎺ュ叆缃戠洘骞垮憡sdk鐨勫垵濮嬪寲鎿嶄綔锛岃鎯呰鎺ュ叆鏂囨。鍜岀┛灞辩敳骞冲彴璇存槑
     private static void doInit(Context context) {
         if (!sInit) {
-            TTAdSdk.init(context, buildConfig(context));
-            sInit = true;
+            try {
+                TTAdSdk.init(context, buildConfig(context));
+                sInit = true;
+            } catch (Exception e) {
+
+            }
         }
     }
 
diff --git a/library-common/src/com/lcjian/library/RetainViewFragment.java b/library-common/src/com/lcjian/library/RetainViewFragment.java
index 8567b90..ba52774 100644
--- a/library-common/src/com/lcjian/library/RetainViewFragment.java
+++ b/library-common/src/com/lcjian/library/RetainViewFragment.java
@@ -11,7 +11,6 @@
     private View mContentView;
 
 
-
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
@@ -22,7 +21,8 @@
             try {
                 ((ViewGroup) mContentView.getParent()).removeView(mContentView);
             } catch (Exception e) {
-                container.removeView(mContentView);
+                if (container != null)
+                    container.removeView(mContentView);
             }
         }
         return mContentView;

--
Gitblit v1.8.0