Confused in v4 and v13 support library

I am creating a new app with min sdk verrsion = 15, so I don't want to use the v4 support library. Now in my application I want to use scrollable tabs, so I need to view the pager for this. Now in my xml when I use something like this I get the error

XMl Code

    xmlns:android="" /> 


But this code works fine with v4 support library.

  • Now why am I not using v13.view.pager ????
  • And if I use v4.view.pager it matches the other fragments as I am not using

source to share

2 answers

Now why am I not using v13.view.pager?

Because there is no such class. ViewPager


. It doesn't matter if you get ViewPager

from support-v4

or support-v13


And if I use v4.view.pager it matches the other fragments as I am not using

. The library support-v13

offers v13

releases FragmentPagerAdapter

and FragmentStatePagerAdapter

that work with native API Level 11+ snippets.



The reason you can't use

it is because it doesn't exist. If you find the ViewPager and click "Link" in the sidebar, you can specify which one ViewPager

is Support v4 based on its package name

. If you are looking for the v13 pod version

, you will see that no such package exists. Conversely,

it does exist , but it does not contain a class ViewPager


AFAIK, the documentation that says ViewPager

to use snippets from the support library is not required. I've only used them with snippets from the v4 support library, but that doesn't mean they won't work with regular snippets.



All Articles