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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:24:39+00:00 2026-06-05T06:24:39+00:00

This is a wierd problem. This will be a terrible question because I have

  • 0

This is a wierd problem.

This will be a terrible question because I have little to no information.

About two days ago I had the ViewPagerAdapter working just fine. I could swipe and it would switch between views as defined by the adapter.

However, all of a sudden (not by itself, I’m sure I did something) the TitlePagerIndicator doesn’t snap to the headings and doesn’t display any content. By not snapping I mean that if I drag to the left, the title will sit at 3/4 of the screen instead of snapping to the side and displaying the next page (screenshot below).

I have debugged and instantiate item is called and a proper view is returned.

However, when I open the app I’m getting a lot of warnings like these:
VFY: unable to resolve virtual method 3015: Landroid/widget/LinearLayout;.getAlpha ()F
VFY: unable to resolve direct method 3011: Landroid/widget/LinearLayout;. (Landroid/content/Context;Landroid/util/AttributeSet;I)V
VFY: unable to resolve virtual method 2965: Landroid/widget/FrameLayout;.setAlpha (F)V

I’m assuming this is a problem with my imports, but everything compiles just fine, I have the ViewPagerIndicator as a library project, as well as Sherlock.

Here’s my adapter code:

public class ViewPagerAdapter extends PagerAdapter implements TitleProvider {

private static String[] titles = new String[] { 
    "My Klinks", 
    "Received Klinks"
    };

private final Context context;

public ViewPagerAdapter(Context context) {
    this.context = context;
}

public String getTitle(int position) {
    return titles[position];
}

@Override
public int getCount() {
    return titles.length;
}

@Override
public Object instantiateItem(View pager, int position) {
    TextView t = new TextView(context);
    t.setText("WheeeE");
    return t;
}

@Override
public void destroyItem(View pager, int position, Object view) {
    ((ViewPager) pager).removeView((TextView) view);
}

@Override
public boolean isViewFromObject(View view, Object object) {
    return view.equals(object);
}

@Override
public void finishUpdate(View view) {
}

@Override
public void restoreState(Parcelable p, ClassLoader c) {
}

@Override
public Parcelable saveState() {
    return null;
}

@Override
public void startUpdate(View view) {
}
}

And here is my activity code:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate( savedInstanceState );
    setContentView( R.layout.main );

    // set up the slidey tabs
    ViewPagerAdapter adapter = new ViewPagerAdapter( this );
    ViewPager pager = (ViewPager)findViewById( R.id.viewpager );
    TitlePageIndicator indicator = (TitlePageIndicator)findViewById( R.id.indicator );
    pager.setAdapter( adapter );
    indicator.setViewPager( pager );

    // set up the action bar
    final ActionBar ab = getSupportActionBar();

    ab.setBackgroundDrawable(getResources().getDrawable(R.drawable.ad_action_bar_gradient_bak));
}

Title indicator not snapping

  • 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-05T06:24:40+00:00Added an answer on June 5, 2026 at 6:24 am

    If someone else gets the same problem:

    In instantiateView: don’t forget to attach your new View to the ViewPager:

    @Override
    public Object instantiateItem(View pager, int position) {
        TextView t = new TextView(context);
        t.setText("WheeeE");
        ((ViewPager)pager).addView(t);
        return t;
    }
    

    The current version of instantiateItem gets a ViewGroup instead of a View, the solution should be the same.

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

Sidebar

Related Questions

I have this wierd problem with my table i Have about 20 cells to
Ok this is a weird problem because I had it working before. So I
This was originally going to be a question about how to implement this because
This is a bit of a wierd problem. (.NET 3.5sp1) I have a UserControl
I have a weird problem where two web apps with Oracle JDBC driver will
I'm using django with app-engine-patch and I'm having this wierd problem running manage.py dumpdata
I have this weird problem, when I create a calendar with a locale, the
I have this weird problem with setting up cookies with PHP. Everything worked fine
This is a weird problem. I have a solution for it, but I don't
I have a weird problem... I use this code: String text = new String(values[0]);

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.