| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | //// //通知栏点击进来,防止应用在后台时被重复启动,阿里云推动通知指定打开某个Activity,没有设置Flags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);默认启动新实例,导致多个实例 |
| | | // if (!isTaskRoot()) { |
| | | // finish(); |
| | | // } |
| | | setStatusBarTranslucent(); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF1C1C1E)); |
| | | //初始化碎片 |
| | |
| | | if (TextUtils.isEmpty(data)) { |
| | | return; |
| | | } |
| | | // PushMessageInfoBean pushMessageInfoBean = new Gson().fromJson(data, PushMessageInfoBean.class); |
| | | PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing("", "", data); |
| | | if (TextUtils.isEmpty(pushMessageInfoBean.getMsgId())) { |
| | | return; |
| | |
| | | //启动页与mainActivity样式一样,这样启动页和mainActivity看上去是一个界面,目的是为了mainActivity遮住下一页; |
| | | // AppManagerUtils.getAppManager().finishActivity(StartActivity.class); |
| | | portConflictDialog(); |
| | | // Intent intent = new Intent(_mActivity, BPowerStationActivity.class); |
| | | // intent.setFlags(Intent.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); |
| | | // intent.putExtra("skip", "skip");//里面判断有这个标识就跳转到消息中心界面 |
| | | // _mActivity.startActivity(intent); |
| | | //点击极光通知栏消息进来 |
| | | // this.clickJpushNotificationMessage(); |
| | | } |
| | | |
| | | |
| | |
| | | // UserConfigManage.getInstance().setRegistrationID(registrationID); |
| | | // UserConfigManage.getInstance().Save(); |
| | | String finalRegistrationID = registrationID; |
| | | HdlResidenceLogic.getInstance().pushAdd(new CloudCallBeak<String>() { |
| | | HdlPushLogic.getInstance().pushAdd(new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String pushId) { |
| | | |
| | |
| | | * @param token 令牌 |
| | | */ |
| | | private void sendPushTokenToServer(final String token) { |
| | | |
| | | if (TextUtils.isEmpty(token)) { |
| | | return; |
| | | } |
| | | HdlResidenceLogic.getInstance().pushAdd(new CloudCallBeak<String>() { |
| | | HdlPushLogic.getInstance().pushAdd(new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String pushId) { |
| | | |
| | | if (!TextUtils.isEmpty(pushId)) { |
| | | UserConfigManage.getInstance().setToken(token); |
| | | UserConfigManage.getInstance().setPushId(pushId); |
| | | UserConfigManage.getInstance().Save(); |
| | | } |
| | | HdlLogLogic.print("添加令牌到云端 PushToken:" + UserConfigManage.getInstance().getPushToken() + " pushId:" + pushId, true); |
| | | } |
| | | |
| | |
| | | showFragment(); |
| | | } |
| | | } else if (event.getTopic().contains(ConstantManage.refresh_push_token)) { |
| | | String token = event.getType(); |
| | | UserConfigManage.getInstance().setPushToken(token); |
| | | UserConfigManage.getInstance().Save(); |
| | | //pushToken更新 |
| | | sendPushTokenToServer(UserConfigManage.getInstance().getPushToken()); |
| | | } |
| | |
| | | */ |
| | | private void clickNotificationMessageTab() { |
| | | //触发消息点击事件 |
| | | viewBinding.myMessageBottomIl2.clickTv.performClick(); |
| | | // if (currentFragmentIndex == 2) { |
| | | // return; |
| | | // } |
| | | // currentFragmentIndex = 2; |
| | | // bottomViewChangeOfStyle(); |
| | | // showFragment(); |
| | | // HdlCommonLogic.lowerTagType = LowerTagType.message; |
| | | // HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.message.toString()); |
| | | // viewBinding.myMessageBottomIl2.clickTv.performClick(); |
| | | if (currentFragmentIndex == 2) { |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house); |
| | | return; |
| | | } |
| | | currentFragmentIndex = 2; |
| | | bottomViewChangeOfStyle(); |
| | | showFragment(); |
| | | HdlCommonLogic.lowerTagType = LowerTagType.message; |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house); |
| | | } |
| | | |
| | | |