From 799b8662790850240bc6e7e6d16241c1a8869a3d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 27 八月 2021 19:02:34 +0800
Subject: [PATCH] 穿山甲广告SDK更新,64位处理器兼容

---
 BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java |   58 +++++++++++++++++++++-------------------------------------
 1 files changed, 21 insertions(+), 37 deletions(-)

diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
index 4b96355..b966618 100644
--- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
+++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java
@@ -43,7 +43,6 @@
 import com.lcjian.library.util.common.StringUtils;
 import com.mozillaonline.providers.downloads.DownloadService;
 import com.qq.e.ads.cfg.VideoOption;
-import com.tencent.android.tpush.XGPushTextMessage;
 import com.umeng.socialize.UMShareAPI;
 import com.umeng.socialize.UMShareListener;
 import com.umeng.socialize.bean.SHARE_MEDIA;
@@ -72,6 +71,7 @@
 import com.weikou.beibeivideo.util.ad.manager.SearchResultAdManager;
 import com.weikou.beibeivideo.util.ui.TopStatusSettings;
 import com.yeshi.appupdate.AppUpdate;
+import com.yeshi.push.PushUtil;
 
 import org.apache.http.Header;
 import org.json.JSONArray;
@@ -86,7 +86,7 @@
 import java.util.List;
 import java.util.Random;
 
-import de.greenrobot.event.EventBus;
+import org.greenrobot.eventbus.EventBus;
 
 //import com.umeng.message.PushAgent;
 
@@ -208,23 +208,27 @@
         });
         preLoadCommonAD();
 
-
-        if (BeibeiConstant.IS_TEST) {
-            tv_search.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    VideoInfo videoInfo = new VideoInfo();
-                    videoInfo.setId("8065880");
-                    videoInfo.setThirdType("0");
-                    Intent intent = new Intent(MainActivity.this, SearchActivity.class);
-                    intent.putExtra("video_info", videoInfo);
-                    startActivity(intent);
-                }
-            }, 2000);
-        }
-
         //鎷夊彇璇︽儏闂
         UserUtil.updateUserInfo(getApplicationContext(), null);
+
+        //鎺ㄩ��
+        PushUtil.inintPush(getApplication(), new PushUtil.ITokenListener() {
+
+            @Override
+            public void onToken(String romType, String regId) {
+                runOnUiThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        BeibeiVideoAPI.pushBindToken(getApplication(), romType, regId, new BasicTextHttpResponseHandler() {
+                            @Override
+                            public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception {
+
+                            }
+                        }, true);
+                    }
+                });
+            }
+        });
     }
 
 
@@ -260,24 +264,6 @@
 
     private boolean isLogin = false;
 
-    /**
-     * 鍒濆鍖栫敤鎴风櫥褰曚俊鎭�
-     */
-
-    public void onEventMainThread(XGPushTextMessage text) {
-        SharedPreferences preferences1 = getSharedPreferences("user",
-                Context.MODE_PRIVATE);
-        isLogin = StringUtils.isEmpty(preferences1.getString("LoginUid", "")) ? false
-                : true;
-        if (text != null && isLogin) {
-            if (preferences1.getBoolean("PushType", false)) {
-                iv_msg_dot.setVisibility(View.VISIBLE);
-            } else {
-                iv_msg_dot.setVisibility(View.GONE);
-            }
-        }
-    }
-
     @Override
     public void onResume() {
         super.onResume();
@@ -287,7 +273,6 @@
         if (!StringUtils.isEmpty(preferences.getString("shopurl", "")) && !preferences.getBoolean("isDown", false)) {
             addDownloadBuxin(preferences.getString("shopurl", ""));
         }
-        EventBus.getDefault().register(this);
 
         PushOpenClickActivity.resumeJumpActivity(this);
     }
@@ -336,7 +321,6 @@
     public void onPause() {
         super.onPause();
         AppUpdate.destoryAppUpdate();
-        EventBus.getDefault().unregister(this);
     }
 
 

--
Gitblit v1.8.0