My PagerAdapter extended android.support.v4.app.FragmentPagerAdapter, but this gave me an error because the super constructor expects a support fragmentmanager as a parameter, while I have an android.app.FragmentManager. I solved this by creating my own copy of FragmentPagerAdapter, which uses the right FragmentManager. Basically, I added
import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction;to my FragmentPagerAdapter.
However, I always use RoboGuice, and this posed an additional problem. RoboGuice uses the support.v4.Fragments, and now I needed the android.app.Fragments. I use an adapted RoboGuice source project anyway, so it was easy to replace the v4 fragments by android.app fragments in the RoboGuice source. This made my app, containing ActionBar Tabs in one Activity, and a ViewPager with android.app.Fragments in another Activity, work perfectly well.
No comments:
Post a Comment