FragmentPagerAdapter cannot be allowed for type

I am trying to follow the Google guide for implementing ViewPager with fragments using the compatibility package as described here: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

I added a compatibility package, and I can create classes that extend the fragment and add a ViewPager to my XML layout, but when I try to create an adapter class that extends the FragmentPagerAdapter, Eclipse doesn't seem to know what it is. What am I missing?

+4
source share
2 answers

So, I fixed this problem by downloading the compatibility library on another computer connected to another network (same as before, via the right-click menu in Eclipse), and then copied the resulting android-support-v4.jar support to the source computer .

The new file was about 137k compared to the 104k version that my local version of Eclipse received. I'm not sure where the discrepancy comes from, but I think that my blocked corporate Internet access blocked the selection of files from the library and left me with an incomplete version.

+2
source

Use the following instructions on this page: http://developer.android.com/training/basics/fragments/support-lib.html , just a matter of adding the android-support-v4.jar library. sorry for my english i'm learning recently

+3
source

Source: https://habr.com/ru/post/1382780/


All Articles