2

I want to use viewpagerindicator with ViewPager in my android application. I've created ViewPager, now I want to display the title of each page in the ViewPager. After reading this I came to know that viewpagerindicator will be helpful. Now the problem is that how can I use this project in my project. I tried adding from properties --> java build path --> Libraries --> add external class folders but it doesn't helped.
I also tried to compile the libraries downloaded from http://viewpagerindicator.com/, but that gives me a bunch of The method setViewPager(ViewPager) of type LinePageIndicator must override a superclass method type errors.

I want to use TabPageIndicator and TitlePageIndicator from viewpagerindicator project in my application as described here.

Community
  • 1
  • 1
Jainendra
  • 24,713
  • 30
  • 122
  • 169
  • You could use the new android PagerTabStrip, it works very nice and is backwards compatible. Here is a nice example project, using the android PagerTabStrip: http://code.google.com/p/viewpage-title-project/ http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html The only thing you need to do is importing the android support library version 9: Right click your project --> android tools --> add support library. – Rolf ツ Oct 17 '12 at 10:34

1 Answers1

1
  1. Download the source code of that project
  2. In your Eclipse workspace: File > New > Project... > Android > Android project from existing code
  3. As the location choose viewpagerindicator/library (this should create the library project in your workspace)
  4. Right click on your project > Properties...
  5. Android > Library > Add...
  6. Select the viewpagerindicator project you have created with previous steps.
  7. Follow the instructions about how to include a view pager indicator in your layouts as on http://viewpagerindicator.com/#usage
Vincent Mimoun-Prat
  • 28,208
  • 16
  • 81
  • 124
  • I tried this but this gives me a bunch of `the method setViewPager(ViewPager) of type LinePageIndicator must override a superclass method` type errors in the library project. – Jainendra Oct 17 '12 at 10:40
  • See http://stackoverflow.com/questions/4761888/override-annotation-error-android-prefs#comment15604122_4762015 – Vincent Mimoun-Prat Oct 17 '12 at 10:43