From de255fa314823290a833c10d30424e42e91f56f0 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 13 七月 2023 16:30:36 +0800 Subject: [PATCH] 安卓后台进入前台问题 --- HDL-ON_Android/SplashActivity.cs | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs index afcffdf..4fccb42 100644 --- a/HDL-ON_Android/SplashActivity.cs +++ b/HDL-ON_Android/SplashActivity.cs @@ -24,10 +24,6 @@ [IntentFilter(new string[] { "com.hdl.onpro.SplashActivity", Intent.ActionView })] public class SplashActivity : Activity { - - - - protected override void OnActivityResult(int requestCode, Result resultVal, Intent data) { if (requestCode == 99) @@ -54,12 +50,20 @@ { base.OnCreate(savedInstanceState); + if(Shared.Application.Activity != null && Shared.Application.Activity.GetType() == typeof(BaseActivity)) + { + Finish(); + return; + } + //Intent i = new Intent(this, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); //StartActivityForResult(i, 1); //OverridePendingTransition(0, 0); //initAll(); if (HDL_ON.OnAppConfig.Instance.FirstRunApp || !HDL_ON.OnAppConfig.Instance.isAgreePrivacyPolicy) { + //OnAppConfig.Instance.FirstRunApp = false; + //OnAppConfig.Instance.SaveConfig(); Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; var localeList = Resources.Configuration.Locale; @@ -185,7 +189,7 @@ } }; - BaseActivity.OnCreateActoin += (activity, application) => + BaseActivity.OnCreateActoin = (activity, application) => { Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; @@ -234,7 +238,7 @@ HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground); }; }; - BaseActivity.RefreshUIAction += (activity) => + BaseActivity.RefreshUIAction = (activity) => { Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; @@ -263,11 +267,11 @@ MainPage.Show(); checkSomeInfo(); }; - BaseActivity.OnResumeAction += (activity) => + BaseActivity.OnResumeAction = (activity) => { checkSomeInfo(); }; - BaseActivity.OnDestroyAction += (activity) => + BaseActivity.OnDestroyAction = (activity) => { Console.WriteLine("OnDestroyAction"); //BusSocket.Stop(); -- Gitblit v1.8.0