From e89fc7322f0199a9d46ec70ae850ab1a41b0fe3e Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期六, 19 十二月 2020 13:12:41 +0800
Subject: [PATCH] 2020-12-19 1.1.iOS和Android 获取天气失败问题,修复调整处理。 2.Android增加网络监听事件,和iOS封装统一监听处理接口。

---
 HDL-ON_Android/Application.cs |   45 +++++++++++++++++++++++++--------------------
 1 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs
index f676103..3d80e26 100644
--- a/HDL-ON_Android/Application.cs
+++ b/HDL-ON_Android/Application.cs
@@ -67,24 +67,29 @@
                 //鑾峰彇鏋佸厜鎺ㄩ�両D
                 GetJPushRegistrationID(activity);
 
-                BaseActivity.NetworkStateChanged += (int obj) =>
+                BaseActivity.NetworkStateChanged += (int internetStatus) =>
                 {
-                    if (!IsEnterBackground)
-                    {
-                        //BusSocket.Stop();
-                        new System.Threading.Thread(() =>
-                        {
-                            System.Threading.Thread.Sleep(1000);
-                            //BusSocket.Start();
-                        })
-                        { IsBackground = true }.Start();
-                    }
-                    else
-                    {
-                        Console.WriteLine("HHH 缃戠粶鍙樺寲浣嗗浜庡悗鍙�");
-                    }
-                    MainPage.InternetStatus = obj;
+                    //if (!IsEnterBackground)
+                    //{
+                    //    ////BusSocket.Stop();
+                    //    //new System.Threading.Thread(() =>
+                    //    //{
+                    //    //    System.Threading.Thread.Sleep(1000);
+                    //    //    //BusSocket.Start();
+                    //    //})
+                    //    //{ IsBackground = true }.Start();
+
+                    //}
+                    //else
+                    //{
+                    //    Console.WriteLine("HHH 缃戠粶鍙樺寲浣嗗浜庡悗鍙�");
+                    //}
+
+                    //缃戠粶鍙樺寲澶勭悊
+                    HDLCommon.Current.UpdateInternetStatus((int)internetStatus, IsEnterBackground);
                 };
+                //寮�鍚畾浣嶆湇鍔�
+                Shared.Application.StartGPSLocationService();
             };
             BaseActivity.RefreshUIAction += (activity) =>
             {
@@ -108,19 +113,19 @@
             HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider");
 
             //Shared.Application.IsGpsEnable = true;
-
             //鑾峰彇缁忕含搴� 
             Shared.Application.LocationAction = (lon, lat) =>
             {
                 try
                 {
                     Shared.Application.LocationAction = null;
-                    Shared.Application.StopGPSLocationService();
                     new HDL_ON.DAL.Server.HttpServerRequest().GetCityInfo(lon.ToString(), lat.ToString());
+                    //鍏抽棴瀹氫綅鏈嶅姟
+                    Shared.Application.StopGPSLocationService();
                 }
-                catch
+                  catch(Exception ex)
                 {
-
+                    Utlis.WriteLine("GetCityInfo catch"+ ex.Message);
                 }
                 MainPage.Log($"缁忕含搴�:::{lon}:{lat}");
             };

--
Gitblit v1.8.0