黄学彪
2020-11-19 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a
ZigbeeApp/GateWay.Droid/Application.cs
@@ -20,7 +20,6 @@
namespace com.hdl.home
{
    [Activity(Name = "com.hdl.home.wxapi.WXEntryActivity", Exported = true, Theme = "@android:style/Theme.Translucent", LaunchMode = Android.Content.PM.LaunchMode.SingleTask)]
    class WXEntryActivity : Android.App.Activity, IWXAPIEventHandler
    {
@@ -83,6 +82,12 @@
    public class Application : Android.App.Application
    {
        public Application(IntPtr handle, Android.Runtime.JniHandleOwnership ownerShip) : base(handle, ownerShip) { }
        /// <summary>
        /// 检测内存泄露的东西
        /// </summary>
        ///private Square.LeakCanary.RefWatcher _refWatcher;
        public override void OnCreate()
        {
            //如果不是App的主进程,则不需要处理
@@ -101,9 +106,16 @@
                //调试:记录系统异常
                Shared.Phone.UserCenter.HdlLogLogic.Current.WriteOtherText(Shared.Phone.UserCenter.DirNameResourse.SystemLogFile, ex.Message + "\r\n" + ex.StackTrace, true, false);
            }
            base.OnCreate();
            // 通过WXAPIFactory工厂,获取IWXAPI的实例
            //api = WXAPIFactory.CreateWXAPI(this, "wx2ec8f53f6fa36e82", true);
            base.OnCreate();
            // 通过WXAPIFactory工厂,获取IWXAPI的实例
            //api = WXAPIFactory.CreateWXAPI(this, "wx2ec8f53f6fa36e82", true);
            //检测内存泄露的东西
            //if (Square.LeakCanary.LeakCanaryXamarin.IsInAnalyzerProcess(this) == false)
            //{
            //    _refWatcher = Square.LeakCanary.LeakCanaryXamarin.Install(this);
            //    _refWatcher.Watch(this);
            //}
            // 将应用的appId注册到微信
            api?.RegisterApp("wx2ec8f53f6fa36e82");
@@ -136,12 +148,14 @@
            var req = new SendAuth.Req { Scope = "snsapi_userinfo", State = "ZigbeeApp" };
            api?.SendReq(req);
        }
        /// <summary>
      /// 所有初始化全部在这个方法实现
      /// </summary>
      void initAll()
        {
            Shared.Application.IsGpsEnable = System.IO.File.Exists(Shared.Phone.UserCenter.DirNameResourse.OpenGbsFile);
            //取消屏幕常亮
            BaseActivity.KeepScreenON = false;
            //隐藏底部软按键
            BaseActivity.IsHideVirualButtons = true;