From be95e839f40eb3ddf64706b60cba6dfcf4fad5e5 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 03 四月 2020 14:31:44 +0800 Subject: [PATCH] 2020-04-03 1.去掉登录前ping百度域名的网络监测。 --- Crabtree/ON/Application.cs | 55 +++++++++++++++++++++++++++++++------------------------ 1 files changed, 31 insertions(+), 24 deletions(-) diff --git a/Crabtree/ON/Application.cs b/Crabtree/ON/Application.cs index 34ad22e..a79c574 100644 --- a/Crabtree/ON/Application.cs +++ b/Crabtree/ON/Application.cs @@ -64,7 +64,7 @@ BaseActivity.BackKeyAction = () => { if (Shared.SimpleControl.MainPage.Loading != null) { - Console.WriteLine (MainPage.Loading.CurStatus); + Utlis.WriteLine (MainPage.Loading.CurStatus); if (Shared.SimpleControl.MainPage.Loading.CurStatus) { Shared.SimpleControl.MainPage.Loading.Hide (); return; @@ -73,7 +73,7 @@ //if(BaseActivity.VerifyDateTime == DateTime.MaxValue) { } else try { var lastView = Shared.Application.MainPage.GetChildren (Shared.Application.MainPage.ChildrenCount - 1); - Console.WriteLine ("lastView " + lastView); + Utlis.WriteLine ("lastView " + lastView); if (MainPage.Loading.CurStatus) { return; } @@ -82,26 +82,26 @@ BaseActivity.VerifyDateTime = DateTime.MaxValue; return; } else { - Console.WriteLine ("Remove Dialog!!!!"); + Utlis.WriteLine ("Remove Dialog!!!!"); var lastView2 = Shared.Application.MainPage.GetChildren (Shared.Application.MainPage.ChildrenCount - 2); lastView.RemoveFromParent (); lastView2.RemoveFromParent (); - Console.WriteLine ("Remove Dialog End!!!!"); + Utlis.WriteLine ("Remove Dialog End!!!!"); BaseActivity.VerifyDateTime = DateTime.MinValue; return; } } } catch (System.Exception ezx) { - Console.WriteLine (ezx.Message); + Utlis.WriteLine (ezx.Message); } if (SharedMethod.SharedMethod.CurPageLayout != null) { if (SharedMethod.SharedMethod.CurPageLayout.ChildrenCount > 1) { - Console.WriteLine ("Remove PageLayout Children!!!!"); + Utlis.WriteLine ("Remove PageLayout Children!!!!"); SharedMethod.SharedMethod.CurPageLayout.GetChildren (SharedMethod.SharedMethod.CurPageLayout.ChildrenCount - 1).RemoveFromParent (); - Console.WriteLine ("Remove PageLayout Children End!!!!"); + Utlis.WriteLine ("Remove PageLayout Children End!!!!"); BaseActivity.VerifyDateTime = DateTime.MinValue; } else { - Console.WriteLine ("BaseActivity.VerifyDateTime = DateTime.MaxValue"); + Utlis.WriteLine ("BaseActivity.VerifyDateTime = DateTime.MaxValue"); BaseActivity.VerifyDateTime = DateTime.MaxValue; } } @@ -120,7 +120,7 @@ UserConfig.Instance.SaveUserConfig (); } BaseActivity.NetworkStateChanged += (int obj) => { - Console.WriteLine ("NetworkStateChanged " + obj); + Utlis.WriteLine ("NetworkStateChanged " + obj); UserConfig.Instance.internetStatus = obj; UserConfig.Instance.SaveUserConfig (); //缃戠粶鍙樺寲閫氱煡 @@ -145,6 +145,7 @@ BaseActivity.OnDestroyAction += (activity) => { BusSocket.Stop (); }; + HDLUtils.SetAuthoritiesName ("com.hdl.crabtreenew.fileProvider"); } public static bool IsShowTip = true; void init () @@ -157,20 +158,26 @@ JPushInterface.Init (this);//淇濆瓨鎵嬫満鍚嶇О鍒版湰鍦版枃浠� //鑾峰彇缁忕含搴� Shared.Application.LocationAction = (arg1, arg2) => { - Shared.Application.LocationAction = null; - System.Threading.Tasks.Task.Run (() => { - while (true) { - try { - Shared.SimpleControl.CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality (arg2.ToString (), arg1.ToString ()); - if (Shared.SimpleControl.CommonPage.AirQuality != null) - break; - } catch { } - } - Shared.Application.RunOnMainThread (() => { - if (CommonPage.RefreshAir != null) - CommonPage.RefreshAir (); + + try { + Shared.Application.LocationAction = null; + Shared.Application.StopGPSLocationService (); + + System.Threading.Tasks.Task.Run (() => { + while (true) { + try { + Shared.SimpleControl.CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality (arg2.ToString (), arg1.ToString ()); + if (Shared.SimpleControl.CommonPage.AirQuality != null) + break; + } catch { } + } + Shared.Application.RunOnMainThread (() => { + if (CommonPage.RefreshAir != null) + CommonPage.RefreshAir (); + }); }); - }); + } catch { + } }; } void checkSomeInfo () @@ -180,7 +187,7 @@ IsShowTip = true; var status = isNetworkAvailable (this); - Console.WriteLine ("status!!!" + status); + Utlis.WriteLine ("status!!!" + status); int internetStatus = 0; if (status) { var isWifi = isWifiConnected (this); @@ -190,7 +197,7 @@ internetStatus = 1; } } - Console.WriteLine (""); + Utlis.WriteLine (""); Shared.SimpleControl.EquipmentPublicClass.CheckLinkRemote (internetStatus, false); } -- Gitblit v1.8.0