After reading ViewPager's source code, I got that ViewPager is directly inherited the ViewGroup class,so it's easy to understand View can added to ViewPager.But from Google doc:
ViewPager is most often used in conjunction with Fragment, which is a convenient way to supply and manage the lifecycle of each page. There are standard adapters implemented for using fragments with the ViewPager, which cover the most common use cases. These are FragmentPagerAdapter and FragmentStatePagerAdapter
We can learn that Fragment can worked with ViewPager. but the following shows that Fragment is not a View.
public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener
so my Question is Why fragment can be nested into ViewPager? How does Fragment work with ViewPager? Is possible to use Activity instead of Fragment?