| | |
| | | import com.hdl.sdk.link.core.connect.HDLUdpConnect; |
| | | import com.hdl.sdk.link.core.utils.QueueUtils; |
| | | import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient; |
| | | import com.umeng.commonsdk.UMConfigure; |
| | | //import com.umeng.commonsdk.UMConfigure; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | |
| | | import cn.jpush.android.api.JPushInterface; |
| | | //import cn.jpush.android.api.JPushInterface; |
| | | import io.dcloud.common.util.RuningAcitvityUtil; |
| | | import me.jessyan.autosize.AutoSize; |
| | | import me.jessyan.autosize.AutoSizeConfig; |
| | |
| | | this.networkMonitoring(); |
| | | //初始化本地assets文件夹资源文件 |
| | | // this.initLocalAssetsData(); |
| | | //初始化友盟SDK |
| | | initUMengSDK(); |
| | | // //初始化友盟SDK,放在StartActivity里面初始化 |
| | | // initUMengSDK(); |
| | | |
| | | |
| | | } |
| | |
| | | * 集成教程地址:https://developer.umeng.com/docs/119267/detail/118588 |
| | | */ |
| | | private void initUMengSDK() { |
| | | UMConfigure.preInit(this, "6801aec0bc47b67d833fd76d", "XenterraSolar"); |
| | | //appkey和channl必须保持和预初始化一致!!! |
| | | //deviceType:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子 |
| | | //pushSecret:Push推送业务的secret |
| | | UMConfigure.init(this, "6801aec0bc47b67d833fd76d", "XenterraSolar", UMConfigure.DEVICE_TYPE_PHONE, ""); |
| | | UMConfigure.setLogEnabled(false);//AppConfigManage.isDebug() |
| | | // UMConfigure.preInit(this, "6801aec0bc47b67d833fd76d", "XenterraSolar"); |
| | | // //appkey和channl必须保持和预初始化一致!!! |
| | | // //deviceType:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子 |
| | | // //pushSecret:Push推送业务的secret |
| | | // UMConfigure.init(this, "6801aec0bc47b67d833fd76d", "XenterraSolar", UMConfigure.DEVICE_TYPE_PHONE, ""); |
| | | // UMConfigure.setLogEnabled(false);//AppConfigManage.isDebug() |
| | | } |
| | | |
| | | |
| | |
| | | HDLLinkPMUser.getInstance().setOnReloginListener(new IOnReloginListener() { |
| | | @Override |
| | | public void onReLogin(int type) { |
| | | |
| | | |
| | | boolean isLoginActivity = false; |
| | | // 获取当前Activity的列表 |
| | | ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); |
| | | List<ActivityManager.RunningTaskInfo> taskInfo = activityManager.getRunningTasks(1); |
| | | // 遍历Activity列表,判断目标Activity是否在列表中 |
| | | for (ActivityManager.RunningTaskInfo info : taskInfo) { |
| | | if (info.topActivity.getClassName().equals("com.hdl.photovoltaic.ui.LoginActivity")) { |
| | | // 目标Activity存在 |
| | | // 在这里可以进行相应处理 |
| | | isLoginActivity = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!isLoginActivity) { |
| | | |
| | | } |
| | | |
| | | |
| | | HdlLogLogic.print("监听到登录退出---" + type, true); |
| | | //type: 0:正常退出 1:极光推送强制退出 |
| | |
| | | * 初始化极光SDK |
| | | */ |
| | | private void initJPush() { |
| | | JPushInterface.setDebugMode(true); |
| | | JPushInterface.init(getBaseContext()); |
| | | // JPushInterface.setDebugMode(true); |
| | | // JPushInterface.init(getBaseContext()); |
| | | } |
| | | |
| | | /** |