FragmentStatePagerAdapter ctor doing strange things


#1

I am following the book slavishly and have gotten to Chapter 11. When I enter the following lines to CrimePagerActivity:

	FragmentManager fm = getSupportFragmentManager(); 
	
	mViewPager.setAdapter(new FragmentStatePagerAdapter(fm) {...}

I get the dreaded red line under ‘FragmentStatePagerAdapter(fm)’, and the popup says: ‘The constructor FragmentStatePagerAdapter() is undefined’ (notice the empty argument list). The quick fix proposed is to add a parameter, and if I do that, I get:

	mViewPager.setAdapter(new FragmentStatePagerAdapter(fmfm) {...}

That is, it doubles up the param. Even renaming the param or substituting ‘null’ does not help.

This looks like Eclipse is not seeing the parameter … but I am at a loss why it is going wrong or how to fix it.

Anyone know about this?

Thanks

Eric


#2

Mother of God, I hate Eclipse.

The problem was a missing semicolon about thirty lines down, right after this:


@Override
public void onPageScrollStateChanged(int arg0) {
// TODO Auto-generated method stub

		}
	});  /// <<<<--------THIS LITTLE F****R HERE ...../ 

Posted for the benefit of the search engines.

Problem solved.