zxt1042064949
zxt1042064949
2019-01-03 20:09

界面旋转导致viewpager中的fragment 对象为空指针

setContentView(R.layout.activity_main);
unbinder = ButterKnife.bind(this);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
mFragmentManager = getSupportFragmentManager();
vpDensity = (DefineViewPager) findViewById(R.id.vp_density);
desity = new Density();
desity1 = new Density();
mFragmentList.add(desity);
mFragmentList.add(desity1);
mViewPagerFragmentAdapter = new ViewPagerFragmentAdapter(mFragmentManager, mFragmentList);

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

相关推荐