The example for viewpager, here, contains the lines:
mViewPager = new ViewPager(this);
mViewPager.setId(R.id.pager);
I don't understand how R.id.pager is defined. Am I supposed to create a viewpager in xml somewhere? But that wouldn't make sense because it's instantiating a viewpager in the previous line. If someone could clear this up for me I would be most grateful!!
Thank you!!
EDIT
Apparently changing the line to:
mViewPager.setId(1);
Makes it work :) :)