From 664834b83a4c50cac039bbfa49f5164ca9bf8e3c Mon Sep 17 00:00:00 2001 From: liugl <liugl@sinata.cn> Date: 星期五, 07 八月 2020 17:05:17 +0800 Subject: [PATCH] 8.7 --- app/src/main/java/com/okgoincar/slab/MySlabBaseActivity.java | 48 +++++++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/okgoincar/slab/MySlabBaseActivity.java b/app/src/main/java/com/okgoincar/slab/MySlabBaseActivity.java index 96bc3c5..0d9b79a 100644 --- a/app/src/main/java/com/okgoincar/slab/MySlabBaseActivity.java +++ b/app/src/main/java/com/okgoincar/slab/MySlabBaseActivity.java @@ -28,6 +28,7 @@ import com.okgoincar.R; import com.okgoincar.base.BaseEvent; +import com.okgoincar.base.MoneyBroadCastReceiver; import com.okgoincar.base.MyApplication; import com.okgoincar.slab.util.DialogUtil; import com.github.zackratos.ultimatebar.UltimateBar; @@ -42,11 +43,13 @@ import java.util.List; import cn.sinata.xldutils.activitys.SlabBaseActivity; +import cn.sinata.xldutils.netstatus.NetUtils; import cn.sinata.xldutils.utils.UtilKtKt; import pub.devrel.easypermissions.EasyPermissions; import static android.view.View.GONE; import static android.view.View.VISIBLE; +import static cn.sinata.xldutils.utils.UtilKtKt.toast; /** * Created by Administrator on 2018/1/16. @@ -95,20 +98,29 @@ } - Handler heartHandler; + @Override + protected void onNetworkConnected(NetUtils.NetType type) { + super.onNetworkConnected(type); +// toast("收到网络变化"); + if (NetUtils.isNetworkConnected(MyApplication.Companion.getInstance())) { + MoneyBroadCastReceiver.Companion.callErrorOrder(this); + } + } + + // Handler heartHandler; private void settest() { - tv_test.setVisibility(VISIBLE); - if (!MyApplication.Companion.getLocation().getAoiName().isEmpty()){ - tv_test.setText( - "定位位置:lat="+MyApplication.Companion.getLocation().getLatitude()+" lng="+MyApplication.Companion.getLocation().getLongitude() - + " 心跳数量()="+MyApplication.Companion.getTestHeartNunm()+" 收到的websocket数量="+MyApplication.Companion.getTestReceiveNum() - +" 方向角="+MyApplication.Companion.getLocation().getBearing()+" 海拔"+MyApplication.Companion.getLocation().getAltitude() - ); - } - if (heartHandler == null) { - heartHandler = new Handler(getMainLooper()); - } - heartHandler.postDelayed(this::settest,2000); +// tv_test.setVisibility(VISIBLE); +// if (!MyApplication.Companion.getLocation().getAoiName().isEmpty()){ +// tv_test.setText( +// "定位位置:lat="+MyApplication.Companion.getLocation().getLatitude()+" lng="+MyApplication.Companion.getLocation().getLongitude() +// + " 心跳数量()="+MyApplication.Companion.getTestHeartNunm()+" 收到的websocket数量="+MyApplication.Companion.getTestReceiveNum() +// +" 方向角="+MyApplication.Companion.getLocation().getBearing()+" 海拔"+MyApplication.Companion.getLocation().getAltitude() +// ); +// } +// if (heartHandler == null) { +// heartHandler = new Handler(getMainLooper()); +// } +// heartHandler.postDelayed(this::settest,2000); } @@ -140,14 +152,6 @@ } - public void showOrder(String orderId, String orderType) { -// Bundle bundle = creatBundleString("orderId", orderId); -// bundle.putString("orderType", orderType); - Intent intent = new Intent(this, SlabGetOrderFragment.class); - intent.putExtra("orderId",orderId); - intent.putExtra("orderType",orderType); - startActivity(intent); - } public void toDorderAct(String orderId, String orderType){ Intent intent = new Intent(this, SlabTripActivity.class); @@ -164,8 +168,6 @@ * @param type */ public void showOrder(String orderId, String orderType,int time,int type) { -// Bundle bundle = creatBundleString("orderId", orderId); -// bundle.putString("orderType", orderType); Intent intent = new Intent(this,SlabGetOrderFragment.class); intent.putExtra("orderId",orderId); intent.putExtra("orderType",orderType); -- Gitblit v1.7.1