mac
2024-05-08 b75795836a851a13e54cc4efb597262fb448217c
app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMPSDKManager.java
@@ -3,6 +3,7 @@
import android.app.Application;
import android.content.Context;
import android.os.Environment;
import android.os.SystemClock;
import android.text.TextUtils;
@@ -279,14 +280,22 @@
                UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();
                uniMPOpenConfiguration.path = path;
                uniMPOpenConfiguration.extraData = jsonObject;
                uniMPOpenConfiguration.splashClass=MySplashView.class;
                uniMP = DCUniMPSDK.getInstance().openUniMP(mContext, uniAppId, uniMPOpenConfiguration);
            }
            //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());
//            initDCUniMPSDK(HDLApp.getInstance());
            HdlLogLogic.print("打开失败===" + e.getMessage());
        }
    }