On Tue, Apr 19, 2011 at 11:10 AM, Dave Johnston <joh...@gmail.com> wrote: > I'm having trouble implementing ActionBar tabs whilst also using > backward-compatible Fragments (with the compatibility package). > > The main issue being that ActionBar.TabListener expects > android.app.Fragment, and my Fragment classes inherit from > android.support.v4.app.Fragment. Therefore I can't use my Fragments > with the ActionBar on 3.0-and-later devices. > > Anyone have any ideas how I can solve or work around this? (besides > just not using tabs)
ActionBar.TabListener does not expect android.app.Fragment. It does, however, supply an android.app.FragmentTransaction as a parameter, rather than the Android Compatibility Library implementation of FragmentTransaction.
What seems to be working for me is to simply ignore the passed-in FragmentTransaction and use your own. See the FeedsTabActivity in this project: