| | |
| | | application.StartActivity(intent); |
| | | Android.OS.Process.KillProcess(Android.OS.Process.MyPid()); |
| | | } |
| | | |
| | | |
| | | public Application(IntPtr handle, Android.Runtime.JniHandleOwnership ownerShip) : base(handle, ownerShip) { } |
| | | public override void OnCreate() |
| | | { |
| | | //注册未处理异常事件 |
| | | |
| | | Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "cb89f20750"); |
| | | if (Shared.Application.Activity != null) |
| | | { |
| | |
| | | initAll(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 所有初始化全部在这个方法实现 |
| | | /// </summary> |
| | |
| | | //隐藏虚拟按键 |
| | | BaseActivity.IsHideVirualButtons = true; |
| | | //实现安卓返回按键 |
| | | BaseActivity.BackKeyAction = () => { |
| | | BaseActivity.BackKeyAction = () => |
| | | { |
| | | try |
| | | { |
| | | var result = MainPage.LoadEvent_BackAction(); |
| | |
| | | { |
| | | Language.CurrentLanguage = "English"; |
| | | } |
| | | |
| | | |
| | | //获取极光推送ID |
| | | GetJPushRegistrationID(activity); |
| | | |
| | |
| | | BaseActivity.OnResumeAction += (activity) => |
| | | { |
| | | checkSomeInfo(); |
| | | |
| | | |
| | | }; |
| | | BaseActivity.OnDestroyAction += (activity) => |
| | | { |
| | |
| | | //UserInfo.Current.unlockTime = DateTime.Now; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider"); |
| | | |
| | |
| | | //关闭定位服务 |
| | | Shared.Application.StopGPSLocationService(); |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | Utlis.WriteLine("GetCityInfo catch"+ ex.Message); |
| | | Utlis.WriteLine("GetCityInfo catch" + ex.Message); |
| | | } |
| | | MainPage.Log($"经纬度:::{lon}:{lat}"); |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="activity"></param> |
| | | void GetJPushRegistrationID(BaseActivity activity) |
| | | { |
| | | |
| | | try |
| | | { |
| | | //保存获取的极光服务器上的注册ID到本地文件 |