0

I am now trying to implement viewpager with fragment. Everything is cool except i got error ViewPager has not been bound. Exception details are logged in Window > Show View > Error Log in xml graphical layout.

And Here's a screenshot of my application. ViewPager

Does anyone know why there is not showing indicator line below title ?

2
  • Please write the exception log...
    – Warpzit
    Oct 5, 2012 at 8:18
  • @Warpzit I just see this error at xml graphical layout. Oct 5, 2012 at 8:23

3 Answers 3

2

I did this project by referring this: https://github.com/JakeWharton/Android-ViewPagerIndicator. Go through that sample project. It will really helps you to solve your problem.

1
  • Actually i can implement the viewpager successfully. I just can't get the tab indicator line below Title even though i just copied the source code from work fine project. Oct 5, 2012 at 8:27
1

For the records, hope it saves someone some time:

  • The Indicator needs to be bound to the ViewPager, something like indicator.setViewPager(viewpager)

  • Without a theme, the ViewPagerIndicator will not work. If you don't want to use the default style, set the ViewPagerIndicator style only as described here

0

Issue has been solved by myself. All i need is just to add theme style android:theme="@style/Theme.PageIndicatorDefaults" in project manifest file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.