I am developing an app for Android 2.2+ and I need to use Fragments. So I added the support library into my project and have been successfully working with Fragments until now.
When I type:
FragmentManager fm = getSupportFragmentManager()
nothing happens. I get an error. So is there an alternate way for going about doing this?
Thanks!
You need to a) make sure you activity extends
FragmentActivityand not just activity and b) make sure your fragment extendsandroid.support.v4.app.Fragmentand notandroid.app.Fragment.