New CrimeFragment() not instantiating


#1

Hi,

I keep getting the error that I need to change type of ‘fragment’ to CrimeFragment, or vice versa.
In this part here,

[code]Fragment fragment = fm.findFragmentById(R.id.fragmentContainer);

	if(fragment == null){
		fragment = new CrimeFragment();
		fm.beginTransaction()
			.add(R.id.fragmentContainer, fragment)
			.commit();
	}[/code]

I tried casting it as a Fragment, but to no avail… any ideas? I’m targeting sdk 19, not sure if that’s the reason why this is happening…


#2

nevermind! Figured it out, since I set the min sdk to 11, I got rid of the support Fragment stuff and it fixed itself.