Difference FragmentPagerAdapter and PagerAdapter

I read the documentation for android pageadapter and fragmentpageadapter and I didn’t see any difference. I mean one is a fragment and one isn’t but.. is that all? I don’t have really much experience with fragments so maybe thats why I don’t notice any difference.
So whats the difference if I use a FragmentPagerAdapter or a PagerAdapter??

  • Listener for ViewFlipper widget flipping events
  • Android RecyclerView + CursorLoader + ContentProvider + “Load More”
  • Run Button is Disabled in Android Studio
  • develop C#/.NET on Android devices
  • Android c2dm registration id format
  • How to determine if a Firebase user is signed in using facebook authentication
  • Related posts:

    Android drawing cache
    is there any diff @null Vs #00000000
    Only allow unique data entry with Android SQLite?
    Plugin Error: required plugin “Android Support” is disabled
    How Do I Stop Gradle for Android From Building *All* Library Module Build Types On Every Build?
    How to query new Android Calendar App Reminders?
  • Android context outside of Activity class
  • Build Android job with connectedInstrumentTest not working on Jenkins
  • Android unit test using ant with library project
  • Android send a image and save url
  • Getting unknown property 'classpath' with Jack compiler for Android
  • Is it better to use multiple SpanObjects or multiple TextViews in Android?
  • 2 Solutions collect form web for “Difference FragmentPagerAdapter and PagerAdapter”

    The difference is that you can use Fragments inside a FragmentPageAdapter. If you want to have fragments that are going to be use in other parts of your code this is your Adapter.
    Otherwise if you only want to have code that isnĀ“t going to be reuse, you can use PagerAdapter.

    Implementation of PagerAdapter that uses a Fragment to manage each page. But I highly recommend to use FragmentStatePagerAdapter class also handles saving and restoring of fragment’s state.

    FragmentStatePagerAdapter version of the pager is more useful when there are a large number of pages, working more like a list view. When pages are not visible to the user, their entire fragment may be destroyed, only keeping the saved state of that fragment. This allows the pager to hold on to much less memory associated with each visited page as compared to FragmentPagerAdapter at the cost of potentially more overhead when switching between pages.

    When using FragmentPagerAdapter the host ViewPager must have a valid ID set.

    Subclasses only need to implement getItem(int) and getCount() to have a working adapter.

    Here is an example implementation of a FragmentStatePagerAdapter pager containing fragments of lists

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.