How can I allow horizontal tab navigation (swipe views) if I’m using action bar navigation tabs?

Is there anything special I have to do to get this to work with ActionBarSherlock?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The code-generated stuff for a “Tabs+Swipe” activity (from BlankActivity in the new activity wizard in Eclipse) has code for this. Basically, your tabs tie into a
ViewPager, callingsetCurrentItem()to change the page, rather than running their ownFragmentTransactionor otherwise affecting the UI. TheViewPagerhandles the horizontal swiping, and you populate those pages using some form ofPagerAdapter(one is code generated for you). See this very related question and answer for more.Other than standard stuff for using ActionBarSherlock, nothing out of the ordinary should be required.
ViewPageris in the Android Support package, which ActionBarSherlock also needs, so you will have that already in your project.Note, though, that action bar tabs only sometimes show up as tabs. In some screen sizes and orientations, they are automatically converted into a drop-down list (per “list navigation” with the action bar instead of “tab navigation”). If you want to use tabs all of the time, rather than using action bar tabs with
ViewPager, usePagerTabStrip(from the Android Support package) or a suitable indicator from ViewPagerIndicator instead.