From 0c60f4bac3c43d6314d3a61e630dac5241a09de8 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 05 六月 2024 18:48:26 +0800
Subject: [PATCH] 2024年06月05日18:48:20
---
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java | 39 +++++++++++++++++++++++++++++++++++----
1 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
index b6119cf..626e270 100644
--- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
+++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -265,7 +265,7 @@
* @param jsonObject 闄勫姞鏁版嵁
* @param callBack 鐩戝惉灏忕▼搴廜therUniMPEvent浜嬩欢
*/
- public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
+ public void openUniMPDelay(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
if (TextUtils.isEmpty(uniAppId)) {
HdlThreadLogic.toast(mContext, "uni Id null");
HdlLogLogic.print("灏忕▼搴廔D 涓嶈兘涓虹┖");
@@ -283,9 +283,40 @@
uniMPOpenConfiguration.splashClass=MySplashView.class;
uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration);
}
- if(TextUtils.isEmpty(mCurrentAppId)){
- //绗竴娆$敤瑕佷紤鐪�
- SystemClock.sleep(1000);
+ //android14鏈変簺璁惧鏈夐棶棰橈紝闇�瑕佺瓑寰�
+ if (android.os.Build.VERSION.SDK_INT >= 34) {
+ if (TextUtils.isEmpty(mCurrentAppId)) {
+ //绗竴娆$敤瑕佷紤鐪�
+ SystemClock.sleep(1000);
+ }
+ }
+ mCurrentAppId = uniAppId;//璁板綍褰撳墠灏忕▼搴�
+ mUniMPCaches.put(uniMP.getAppid(), uniMP);
+ } catch (Exception e) {
+ e.printStackTrace();
+ HdlThreadLogic.toast(HDLApp.getInstance(), R.string.uni_open_error);
+// initDCUniMPSDK(HDLApp.getInstance());
+ HdlLogLogic.print("鎵撳紑澶辫触===" + e.getMessage());
+ }
+ }
+
+ public void openUniMP(String uniAppId, String path, JSONObject jsonObject, IOnOtherUniMPEventCallBack callBack) {
+ if (TextUtils.isEmpty(uniAppId)) {
+ HdlThreadLogic.toast(mContext, "uni Id null");
+ HdlLogLogic.print("灏忕▼搴廔D 涓嶈兘涓虹┖");
+ return;
+ }
+ try {
+ setOnOtherUniMPEventCallBack(callBack);
+ uniMP = null;
+ if (TextUtils.isEmpty(path)) {
+ uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId);
+ } else {
+ UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();
+ uniMPOpenConfiguration.path = path;
+ uniMPOpenConfiguration.extraData = jsonObject;
+ uniMPOpenConfiguration.splashClass=MySplashView.class;
+ uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration);
}
mCurrentAppId = uniAppId;//璁板綍褰撳墠灏忕▼搴�
mUniMPCaches.put(uniMP.getAppid(), uniMP);
--
Gitblit v1.8.0