diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/WhActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/WhActivity.java index 3be63ae6..82e2c767 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/WhActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/WhActivity.java @@ -44,6 +44,12 @@ public class WhActivity extends BaseActivity { viewPager.setOffscreenPageLimit(4); bottomNavigationView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); } + + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + } + private void initTopBar() { mTopBar.setTitle("系统维护"); mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { @@ -53,12 +59,12 @@ public class WhActivity extends BaseActivity { } }); } - + FragmentAdapter fragmentAdapter=null; /** * viewPager里添加fragment */ private void initFragment() { - FragmentAdapter fragmentAdapter = new FragmentAdapter(getSupportFragmentManager()); + fragmentAdapter = new FragmentAdapter(getSupportFragmentManager()); fragmentAdapter.addFragment(new SystemCsPLCFragment()); fragmentAdapter.addFragment(new SystemCsJrFragment()); diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java index fdfa4439..49f916f2 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/SystemCsPLCFragment.java @@ -63,7 +63,7 @@ public class SystemCsPLCFragment extends BaseFragment { ArrayList arrayList= QueryDB.GetPlcaddressALL(); for (BPA_PLCADDRESS item:arrayList) { - fragment_plc gongxu=new fragment_plc(getContext(),null,item); + fragment_plc gongxu=new fragment_plc(this.context,null,item); plcview.addView(gongxu); } }