4

I found some problems when implementing Jake Wharton's ViewPagerIndicator. These are what stated on Logcat:

06-19 15:32:02.661: E/AndroidRuntime(692): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aprian.learn/com.aprian.learn.VPIndicator}: android.view.InflateException: Binary XML file line #7: Error inflating class com.viewpagerindicator.TitlePageIndicator

I have put on the viewpagerindicator library and already put it in build path, but still failed to start the app.

2
  • did you addded to Android->Libraries? Commented Jun 19, 2012 at 8:41
  • already add it to Android > Libraries, but still have the same probs, and on the console it stated "could not find com_viewpagerindicator.apk" Commented Jun 19, 2012 at 9:10

1 Answer 1

8

You need to add the ViewPagerIndicator as a Libarary project as per Referencing Library Projects. Using it as a .jar-file doesn't work.

Basic steps are: Add the ViewPagerIndicator as a New Project from existing source and

To add a reference to a library project, follow these steps:

  1. In the Package Explorer, right-click the dependent project and select Properties.
  2. In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
  3. Click Add to open the Project Selection dialog.
  4. From the list of available library projects, select a project and click OK.
  5. When the dialog closes, click Apply in the Properties window.
  6. Click OK to close the Properties window.

If this doesn't work, try Project -> Clean.

Edit: Also see this answer from Jake Wharton : Answer

Sign up to request clarification or add additional context in comments.

4 Comments

is it correct to put "<com.viewpagerindicator.TitlePageIndicator .../>" on my XML layout? thanks for the response
then i think the problem lies on my ViewPagerAdapter? my constructor for the adapter ispublic ViewPagerAdapter (Context context) { this.context = context; }
That's correct. Are you using Eclipse? Tried Clean and/or restarting? Do you have any errors in the viewpagerproject?
yeah. It works well now, well i dont even know how it works. no change done to it, maybe restarting do the job. thanks

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.