当前位置: 代码迷 >> 综合 >> viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager()
  详细解决方案

viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager()

热度:19   发布时间:2024-01-11 14:39:30.0

Null Pointer Exeception on viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(),alFragment));
viewPager未初始化
you can debug a NullPointerException yourself by adding things like:

if(viewPager == null){ Log.e("MainActivity", "viewPager should not be null"); }
  相关解决方案