diff --git a/app/src/main/java/com/bonait/bnframework/common/view/AddGoodDialog.java b/app/src/main/java/com/bonait/bnframework/common/view/AddGoodDialog.java index a2283f6a..cc3414e6 100644 --- a/app/src/main/java/com/bonait/bnframework/common/view/AddGoodDialog.java +++ b/app/src/main/java/com/bonait/bnframework/common/view/AddGoodDialog.java @@ -397,4 +397,10 @@ public class AddGoodDialog extends Dialog { | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } }; + + @Override + public void dismiss() { + super.dismiss(); + MessageManager.getInstance().unRegisterMessageReceiver(activity_ma); + } } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java index 308e5457..7cbf1e9a 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java @@ -81,15 +81,8 @@ import com.bonait.bnframework.common.message.MessageManager; import com.bonait.bnframework.common.utils.AlertDialogUtils; import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.modules.home.adapter.loadinggood_adapter; -import com.bonait.bnframework.modules.home.adapter.wl_adapter; -import com.bonait.bnframework.modules.home.fragment.mode.SerialInter; -import com.bonait.bnframework.modules.home.fragment.mode.SerialManage; -import com.bonait.bnframework.modules.home.fragment.mode.SerialPortRead; -import com.bonait.bnframework.modules.home.fragment.mode.ShaoMaSave; -//import com.bonait.bnframework.modules.home.fragment.mode.ShaomaTest; import com.bonait.bnframework.modules.home.fragment.mode.add_makegood_control; import com.bonait.bnframework.modules.home.fragment.mode.add_manguan_control; -import com.bonait.bnframework.modules.home.fragment.mode.add_pf_control; import com.bumptech.glide.Glide; import com.litao.slider.NiftySlider; import com.orhanobut.logger.Logger; @@ -822,6 +815,7 @@ public class MakeGoodFragment extends BaseFragment { rv_right.setAdapter(null); Glide.get(getContext()).clearMemory(); + MessageManager.getInstance().unRegisterMessageReceiver(getActivity()); } /** diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java index e9f1fc6e..93138ce9 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java @@ -420,9 +420,12 @@ public class GoodPeiFangActivity extends BaseActivity { @Override public void onDestroy() { + add_pf.destroy(); + add_good.destroy(); super.onDestroy(); rv_right.setAdapter(null); Glide.get(this).clearMemory(); + MessageManager.getInstance().unRegisterMessageReceiver(this); } @Override diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java index f534b920..7ee4f431 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java @@ -228,6 +228,7 @@ public class SilosNewActivity extends BaseActivity { @Override public void onDestroy() { super.onDestroy(); + MessageManager.getInstance().unRegisterMessageReceiver(this); } @Override diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java index c62f99d1..80b1a6ba 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java @@ -114,6 +114,7 @@ public class Silos_item_fragment extends BaseFragment { public void onDestroy() { super.onDestroy(); Logger.d("我的fragment销毁"); + MessageManager.getInstance().unRegisterMessageReceiver(getActivity()); } /** diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java index d29a1a5d..574d0bf9 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java @@ -227,6 +227,10 @@ public class add_good_control extends LinearLayout { }); } + public void destroy(){ + MessageManager.getInstance().unRegisterMessageReceiver(activity_ma); + } + public String ids=""; /** * 数据验证 diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java index 3b4a9924..3ba9e9ae 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_pf_control.java @@ -317,6 +317,13 @@ public class add_pf_control extends LinearLayout implements MyClickListener { } } + public void destroy(){ + Activity activity = findActivity(acontext); + if (activity != null) { + MessageManager.getInstance().unRegisterMessageReceiver(activity); + } + } + /** * 保存数据 */ diff --git a/app/src/main/res/layout/fragment_gongneng.xml b/app/src/main/res/layout/fragment_gongneng.xml index a6a02b87..3a9443c6 100644 --- a/app/src/main/res/layout/fragment_gongneng.xml +++ b/app/src/main/res/layout/fragment_gongneng.xml @@ -245,20 +245,20 @@ android:background="@color/app_color_blue" > + android:layout_height="?attr/qmui_topbar_height">