Move this lines before createActionBar();
mViewPager = (ViewPager) findViewById(R.id.pager);
You are crashing because you haven't initialized mViewPager yet, and you are trying to use it. If you wait until after you've set mViewPager, it should work.
The other possibility is that you don't have a ViewPager in activity_main.xml
with id pager
.