From 8087a7d587c9bc3a448e4421bc604f3e71f181a3 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期五, 15 十二月 2023 18:07:33 +0800 Subject: [PATCH] 2023年12月15日18:07:27 --- app/src/main/java/com/hdl/photovoltaic/HDLApp.java | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/HDLApp.java b/app/src/main/java/com/hdl/photovoltaic/HDLApp.java index 17c4dda..1854535 100644 --- a/app/src/main/java/com/hdl/photovoltaic/HDLApp.java +++ b/app/src/main/java/com/hdl/photovoltaic/HDLApp.java @@ -8,6 +8,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.os.IBinder; +import android.text.TextUtils; import android.util.DisplayMetrics; @@ -22,6 +23,7 @@ import com.hdl.photovoltaic.internet.HttpServer.MyNanoHttpService; import com.hdl.photovoltaic.other.HdlFileLogic; import com.hdl.photovoltaic.other.HdlOtaLogic; +import com.hdl.photovoltaic.other.HdlThreadLogic; import com.hdl.photovoltaic.ui.HomeLoginActivity; import com.hdl.photovoltaic.uni.HDLUniMPSDKManager; import com.hdl.photovoltaic.utils.AppManagerUtils; @@ -40,6 +42,7 @@ import okhttp3.logging.HttpLoggingInterceptor; public class HDLApp extends Application { + //鎺у埗鎵撳嵃 Debug妯″紡鎵撳嵃 private Boolean isLogEnabled = true; //涓夋柟sdk鍒濆鍖栨爣璇� @@ -59,8 +62,22 @@ super.onCreate(); mHDLApp = this; + SharedPreUtils.init(this); + getAppLanguage(); initThirdSDK(); + } + public void getAppLanguage() { + String language = UserConfigManage.getInstance().getCurrentAppLanguage(); + if (TextUtils.isEmpty(language)) { + //浠庡唴瀛橀噷闈㈣幏鍙栦笉鍒拌瑷�,鑾峰彇褰撳墠绯荤粺鐨�; + String str = getResources().getConfiguration().locale.getCountry(); + if (str.equals("CN") || str.equals("TW")) { + UserConfigManage.getInstance().setCurrentAppLanguage(LocalManageUtil.zh); + } else { + UserConfigManage.getInstance().setCurrentAppLanguage(LocalManageUtil.en); + } + } } public void setInfoMap(String key, String value) { @@ -116,7 +133,6 @@ initSocket(); //4.鍒濆鍖朞KHttpLog 鏄惁寮�鍚� setOKHttpLogOpen(isLogEnabled); - } @@ -200,8 +216,10 @@ } } - - + private void initJPush() { +// JPushInterface.setDebugMode(true); +// JPushInterface.init(getBaseContext()); + } // /** @@ -216,8 +234,6 @@ // LogUtils.e("娴嬭瘯Mqtt杩炴帴鏈嶅姟绔け璐�"); // } // } - - } -- Gitblit v1.8.0