| | |
| | | package com.hdl.photovoltaic.ui; |
| | | |
| | | |
| | | import android.app.ActivityManager; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | |
| | | this.pushTokens(); |
| | | //获取云端脚本 |
| | | HdlESLocalJsonLogic.getInstance().getAllHdlESLocalJson(); |
| | | mForegroundService= new Intent(this, ForeService.class); |
| | | startService(); |
| | | // mForegroundService= new Intent(this, ForeService.class); |
| | | // startService(); |
| | | } |
| | | |
| | | Intent mForegroundService; |
| | | |
| | | private void startService(){ |
| | | // Android 8.0使用startForegroundService在前台启动新服务 |
| | | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ |
| | |
| | | // } |
| | | if (TextUtils.isEmpty(HDLLinkPMUser.getInstance().getAccessToken())) { |
| | | //其实刷新token失败已通知退出登录,数据已经清空,因为等2s uni加载慢导致请求链接的时候出现token为空 |
| | | HdlLogLogic.print("返回去"); |
| | | HdlLogLogic.print("返回去---",true); |
| | | return; |
| | | } |
| | | UserConfigManage.getInstance().setUniBottomSafeDistanceBackgroundColor(0); |
| | |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS_C + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus(); |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 物理按键返回事件(包括左滑移除事件) |
| | |
| | | HdlUniLogic.getInstance().checkRemoveOtherUniMPEventCallBack(); |
| | | //移除监听 |
| | | HDLLinkLocalSdk.getInstance().removeAllTopicsListener(allTopicsListener); |
| | | stopService(mForegroundService); |
| | | // stopService(mForegroundService); |
| | | } |
| | | |
| | | /** |