viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager()

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"); }

你可能感兴趣的:(android)