@Override
        public Fragment getItem(int position) {
            if(position == 0) {
                return ScanFragment.newInstance();
            } else {
                return CameraFragment.newInstance();
            }

        }
A {@link FragmentPagerAdapter} that returns a fragment corresponding to
one of the sections/tabs/pages.
sample/src/main/java/example/zxing/TabbedScanning.java