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 8782985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:42:40+00:00 2026-06-13T20:42:40+00:00

I am running the example code provided with ABS (SampleTabsDefault). I added the OnPageChangeListener

  • 0

I am running the example code provided with ABS (SampleTabsDefault). I added the OnPageChangeListener as shown below, now the TabPageIndicator is always stuck on the first tab even though the tab content changes. Am I doing something wrong?

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_tabs);

    mAdapter = new GoogleMusicAdapter(getSupportFragmentManager());

    mPager = (ViewPager)findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);

    mIndicator = (TabPageIndicator)findViewById(R.id.indicator);
    mIndicator.setViewPager(mPager);

    ViewPager.OnPageChangeListener changeListener = new ViewPager.OnPageChangeListener() {

       @Override
       public void onPageScrolled(int i, float v, int i1) {}

       @Override
       public void onPageSelected(int i) {}

       @Override
       public void onPageScrollStateChanged(int i) {}
    };

    mPager.setOnPageChangeListener(changeListener);
    mIndicator.setOnPageChangeListener(changeListener);
}
  • 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-13T20:42:42+00:00Added an answer on June 13, 2026 at 8:42 pm

    The issue was that setting a change listener was overriding the code responsible for switching tabs. I could have subclassed the ABS class, but elected to switch to a TitlePageIndicator which does not have any issues with setting the listener..

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

Sidebar

Related Questions

I'm building a running light library on top of raphaeljs. In the code example
I was already running a sub-website under following path http://example.com/sub-site/ Now, I have created
I am getting errors running the following code. I have provided comments to describe
Provided the following example code: <?php $handle = fopen(/tmp/test_file/sometestfile, r); $contents = ''; while
Recently I was running the example provided by Andrew Hunter on his blog The
i have tried to get the sine wave example running on an AsioOut, but
I am trying to get an example application running with blackberry-py. I adhered to
According to Single-Threaded Application with Long-Running Calculation MSDN example, there is a possibility of
When running the MVC 2 Areas example that has a Blog Area and Blog
I am running a sample push notification example.I have done the c2dm signup and

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.