Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:52:19+00:00 2026-06-04T16:52:19+00:00

I use the ActionBarSherlock and ViewPagerIndicator libs to implement the sliding effect and action

  • 0

I use the ActionBarSherlock and ViewPagerIndicator libs to implement the sliding effect and action bar. As a result, I can swipe the different Fragments, but the indicator title is not displayed.

Captured Screen

Here’s my FragmentActivity

public class eventActivity extends SherlockFragmentActivity {
    ViewPagerFragmentAdapter mAdapter;
    ViewPager mPager;
    PageIndicator mIndicator;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.event_layout);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayUseLogoEnabled(true);

    mAdapter = new ViewPagerFragmentAdapter(getSupportFragmentManager());
    mPager = (ViewPager)findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
    mIndicator.setViewPager(mPager);
    mIndicator.setCurrentItem(1);

}
   ......

Here’s my adapter

    public static class ViewPagerFragmentAdapter extends FragmentPagerAdapter implements TitleProvider {

    ArrayList<Fragment> fragments = new ArrayList<Fragment>();
    ArrayList<String> titles = new ArrayList<String>();

    public ViewPagerFragmentAdapter(FragmentManager fm) {
        super(fm);
        fragments.add(new eventInvitedFragment());
        titles.add("Invited");
        fragments.add(new eventAllFragment());
        titles.add("all");
        fragments.add(new eventParticipatedFragment());
        titles.add("participated");
    }


    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public String getTitle(int position) {
        return titles.get(position);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:52:20+00:00Added an answer on June 4, 2026 at 4:52 pm

    I have solved the problem by changing the getTitle(int position) to getPageTitle(int) in ViewPagerFragmentAdapter.
    ViewPagerIndicator ChangLog has the following description:

    Title indicator adapter callback now uses the standard getPageTitle(int) method introduced in the r6 version of the support library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ActionBarSherlock to implement action bar on my Android 2.1 API 7
If I use ActionBarSherlock 3.5.1 everything is fine and workes. But if I want
My own project is using Android 2.1 API 7 . To implement action bar,
i'm pretty confused on how to use action bar sherlock.. i've 'installed' it successfully
I would like to use the library ActionBarSherlock in one of my projects, but
Possible Duplicate: ActionBarSherlock 4.0 doesn't work. But 3.5.1 do. I'm trying to use ActionBarSherlock
I've been trying to learn how to use the ActionbarSherlock to customize my application
I'm using the ActionBarSherlock for my application and this is the code I use
use this website a lot but first time posting. My program creates a number
I am trying to use Jake Wharton's ActionBarSherlock to support actionbars in android projects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.