I've noticed that when making small ordering changes, the compiler will not pick it up. A ClassCastException is occurring because findViewById is actually returning the wrong view given R.id.pager, or more accurately - R.id.pager is not referring to the correct view.
The way to fix this is to just clean and re-build your project.